| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3249 人关注过本帖
标题:用vb.net做的一个股票数据下载程序
取消只看楼主 加入收藏
xyxcc177
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:26
帖 子:197
专家分:1249
注 册:2017-7-8
结帖率:100%
收藏
 问题点数:0 回复次数:1 
用vb.net做的一个股票数据下载程序
有新需求进一步完善。
setup.rar (468.05 KB)
搜索更多相关主题的帖子: vb.net 票数 需求 
2018-03-11 14:30
xyxcc177
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:26
帖 子:197
专家分:1249
注 册:2017-7-8
收藏
得分:0 
程序代码:

 Private Sub GetImage(ByVal strUrl As String, ByVal Pict As PictureBox) '显示网上图片程序
        Try
            Dim request As HttpWebRequest = WebRequest.Create(strUrl)
            request.Timeout = 20000
            request.ServicePoint.ConnectionLimit = 100
            request.ReadWriteTimeout = 30000
            request.Method = "GET"
            Dim response As HttpWebResponse = request.GetResponse()
            If (response.StatusCode <> HttpStatusCode.OK) Then
                Exit Sub
            End If
            Dim resStream As Stream = response.GetResponseStream()
            Pict.Image = New Bitmap(resStream) '这个是winform中的控件
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

 Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted  '用webbrowser控件解析表格数据
        Try
            bk_tity += 1
        If bk_tity = 5 Then
            Dim j As Int16 = 0
            bk_tity = 0
            hy_Table.Clear()
            Dim tr_arr As HtmlElementCollection
            Dim k As Int16
            Dim sVal_1 As HtmlElement
            Dim sVal As HtmlElement
            tr_arr = WebBrowser1.Document.GetElementsByTagName("table")(0).GetElementsByTagName("tr")
                Dim ct As Int16 = tr_arr.Count - 1
            For Each sVal_1 In tr_arr
                    If j > 0 And j < ct Then
                        k = 0
                        Dim dRow As DataRow = hy_Table.NewRow
                        For Each sVal In sVal_1.GetElementsByTagName("td")
                            dRow(k) = sVal.OuterText
                            k = k + 1
                        Next
                        hy_Table.Rows.Add(dRow)
                    End If
                j += 1
            Next

        End If
        Catch ex As Exception

        End Try
    End Sub




其它没有什么了
2018-03-31 14:06
快速回复:用vb.net做的一个股票数据下载程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021828 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved