随笔-97  评论-105  文章-46  trackbacks-1

vb.net获取网页的简单示例

    Private Function getSourceHtml() As String
        
Dim result As String = ""
        
Try
            
Dim i As Integer = Int(Rnd(Now.Second) * 10 + 1)
            
Dim web As New System.Net.WebClient()
            web.Headers.Add(
"Content-Type""application/x-www-form-urlencoded")
            
Dim d As Byte() = System.Text.Encoding.UTF8.GetBytes("method=copy&u=123&p=123")
            
Dim res As Byte() = web.UploadData("www.junjv.com""POST", d)
            result 
= Encoding.UTF8.GetString(res)
        
Catch ex As Exception
            
'MsgBox(ex.Message)
        End Try
        
Return result
    
End Function

等于http://www.junjv.com/?method=copy&u=123&p=123

 

posted on 2011-09-18 01:03 Konimeter 阅读(21) 评论(0) 编辑 收藏
我的公司:
ShangXun.Net一站式网络服务
昵称:Konimeter
园龄:6年5个月
粉丝:1
关注:1
<2011年9月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

搜索

 
 

常用链接

随笔分类(96)

文章分类(15)

.NET

最新评论

推荐排行榜