Public Function webCaptureContent(ByVal mWebsiteUrl As String, ByVal mWebsiteType As Boolean) As String
目前創(chuàng)新互聯(lián)已為上1000家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬主機(jī)、網(wǎng)站改版維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、鋼城網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。
'啟動(dòng)一次具體的數(shù)據(jù)采集工作,返回采集到的HTML內(nèi)容:要求必須輸入帶://的全地址數(shù)據(jù)
On Error Resume Next
Dim Str_WebContent As String = "請(qǐng)輸入查找網(wǎng)站地址."
Dim wb As WebClient = New WebClient() '//創(chuàng)建一個(gè)WebClient實(shí)例
If mWebsiteUrl.IndexOf("://") 0 Then
'//獲取或設(shè)置用于對(duì)向 Internet 資源的請(qǐng)求進(jìn)行身份驗(yàn)證的網(wǎng)絡(luò)憑據(jù)。(可有可無(wú))
wb.Credentials = CredentialCache.DefaultCredentials
'//從資源下載數(shù)據(jù)并返回字節(jié)數(shù)組。(加@是因?yàn)榫W(wǎng)址中間有"/"符號(hào))
Dim pagedata As Object = wb.DownloadData(mWebsiteUrl)
'//轉(zhuǎn)換字符
If mWebsiteType Then
Str_WebContent = Encoding.Default.GetString(pagedata)
Else
Str_WebContent = Encoding.UTF8.GetString(pagedata)
End If
End If
Return Str_WebContent '提取出來(lái)新聞內(nèi)容,刪除Body前后的多余內(nèi)容,同時(shí)補(bǔ)充上該 Body標(biāo)記,形成完整的內(nèi)容 Str_WebContent '
End Function
簡(jiǎn)單說(shuō)下思路吧,具體的代碼可以查資料
首先要會(huì)畫曲線圖,有三種方法:
1、用mschar控件(vb6的);2、用水晶報(bào)表;3、用word圖表
x軸為時(shí)間,y軸為數(shù)據(jù)
要實(shí)現(xiàn)實(shí)時(shí)數(shù)據(jù)刷新,只要用 定時(shí)器 定時(shí)刷新曲線圖的數(shù)據(jù)就可以了(x、y的數(shù)據(jù)重寫)
已寫好,經(jīng)過(guò)測(cè)試,一個(gè)WEBBROWSER控件,一個(gè)LISTBOX控件,我也初學(xué)習(xí)VB.NET,共同進(jìn)步
Public Class Form1
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
WebBrowser1.Visible = False
WebBrowser1.Navigate(";_fmw.i._0.c=_fmw.i._0.ca=_fmw.i._0.cat=_fmw.i._0.k=%B7%FE%D7%B0_fmw.i._0.t=_fmw.i._0.p=1_fmw.i._0.pa=20_fmw.i._0.u=_fmw.i._0.s=event_submit_do_search_2=true")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim tmp As String
tmp = WebBrowser1.Document.Body.InnerHtml
Dim a() As String
a = Split(tmp, "群號(hào):")
For i = 0 To UBound(a)
If Trim(Strings.Mid(a(i), 1, 6)) = "/SPAN" Then
tmp = Strings.Mid(a(i), Strings.InStr(a(i), "('") + 2, 20)
tmp = Strings.Mid(tmp, 1, Strings.InStr(tmp, "',''") - 1)
ListBox1.Items.Add(tmp)
End If
Next
End Sub
End Class