vb.net网页常用代码 vbnet web编程
请教一段VB.net代码?请高手指点下
vb.net采用的GDI+实现图形绘制,不再使用VB6的Print、Line等语句
创新互联建站于2013年成立,先为肇州等服务建站,肇州等地企业,进行企业商务咨询服务。为肇州企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。
'改成这样试试
Sub Add(ByVal a As Integer, ByVal b As Integer)
a=a+1
b+b+1
End Sub
vb.net怎样用代码实现打开网址
System.Diagnostics.Process.Start("")
或者用 WebBrowser控件,代码 WebBrowser1.Url = New System.Uri("")
一个vb.net的用户登陆页面代码
Private Sub Button _Click(ByVal sender As System Object ByVal e As System EventArgs) Handles Button Click
If TextBox Text = Or TextBox Text = Then
Label Text = 请确认您的输入!
Return
End If
Dim sql As String = select * from pwd where stu_id=@stu_id and pwd=@pwd
Dim m As SqlCommand = New SqlCommand(sql conn)
m Parameters Add(New SqlParameter( @stu_id SqlDbType Int ))
m Parameters( @stu_id ) Value = TextBox Text
m Parameters Add(New SqlParameter( @pwd SqlDbType Char ))
m Parameters( @pwd ) Value = TextBox Text
Dim dr As SqlDataReader
conn Open()
dr = m ExecuteReader
If dr Read Then
Session( stu_id ) = TextBox Text
dr Close()
m Cancel()
Dim sql_ As String = update stu_base set point=point+ where stu_id=@stu_id
m = New SqlCommand(sql_ conn)
m Parameters Add(New SqlParameter( @stu_id SqlDbType Int ))
m Parameters( @stu_id ) Value = Session( stu_id )
m ExecuteNonQuery()
m Cancel()
Response Redirect( detail aspx?stu_id= Session( stu_id ) )
Else
Label Text = 您还没有注册或账号密码错误
End If
End Sub
Private Sub Button _Click(ByVal sender As System Object ByVal e As System EventArgs) Handles Button Click
TextBox Text =
TextBox Text =
lishixinzhi/Article/program/net/201311/13960
如何用vb.net获得网页的源代码
Dim url As String=" 网址"
Dim httpReq As System.Net.HttpWebRequest
Dim httpResp As System.Net.HttpWebResponse
Dim httpURL As New System.Uri(url)
httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)
httpReq.Method = "GET"
httpResp = CType(httpReq.GetResponse(), HttpWebResponse)
httpReq.KeepAlive = False ' 获取或设置一个值,该值指示是否与
Internet资源建立持久连接。
Dim reader As StreamReader = _
New StreamReader(httpResp.GetResponseStream,
System.Text.Encoding.GetEncoding(-0))
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码
VB.NET中的代码
大概的过程:
Imports System.Data
Imports System.Data.SqlClient
--------------
Dim a As New SqlDataAdapter
Dim con As SqlConnection
con = New SqlConnection( "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=.;Connect Timeout=30")
con.Open()
a.SelectCommand = New SqlCommand("select * from table where c=1", con)
a.UpdateCommand = New SqlCommand("update table set b=2 where c=1", con)
a.DeleteCommand = New SqlCommand("delete from table where c=1", con)
a.InsertCommand = New SqlCommand("insert into table values (1,2,3)", con)
a.SelectCommand.ExecuteNonQuery()
a.UpdateCommand.ExecuteNonQuery()
a.DeleteCommand.ExecuteNonQuery()
a.InsertCommand.ExecuteNonQuery()
con.Close()
a.Dispose()
文章名称:vb.net网页常用代码 vbnet web编程
文章路径:http://azwzsj.com/article/hjesci.html