其實做這個純粹係為左方便自己~~
Function funcLoadQuote(ByVal iNum As Integer) As Single
Dim iStartPos As Integer
Dim sContent As String
Dim sQuoteContent As String = ""
Dim iQuoteValue As String
Dim sUpDrop As String = "+"
Dim oRequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.etnet.com.hk/www/tc/stocks/realtime/quote.php?code=" & iNum)
oRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 1.2.30703)"
Dim oResponse As System.Net.WebResponse = oRequest.GetResponse()
Dim oReader As System.IO.StreamReader = New System.IO.StreamReader(oResponse.GetResponseStream)
sContent = oReader.ReadToEnd
iStartPos = InStr(sContent, "../../common/images/arrow_green_L.gif", CompareMethod.Text)
sUpDrop = "-"
If iStartPos <= 0 Then
iStartPos = InStr(sContent, "../../common/images/arrow_red_L.gif", CompareMethod.Text)
sUpDrop = "+"
End If
If iStartPos >= 0 Then
sQuoteContent = Mid(sContent, iStartPos, 100).ToString
iStartPos = InStr(sQuoteContent, ">", CompareMethod.Text)
iQuoteValue = Right(sQuoteContent, Len(sQuoteContent) - iStartPos)
If sUpDrop = "+" Then
Response.Write("<tr><td>HKG : " & iNum & "</td><td>" & sUpDrop & "</td><td><font color='green'>" & iQuoteValue & "</td></tr>")
Else
Response.Write("<tr><td>HKG : " & iNum & "</td><td>" & sUpDrop & "</td><td><font color='red'>" & iQuoteValue & "</td></tr>")
End If
Else
Response.Write("<tr><td>HKG : " & iNum & "</td><td>-</td><td>-</td></tr>")
End If
End Function







嘿嘿









)
)
。。。原來工作之餘,是順手去互相交流,嘿嘿)






