如何不用股票软件查看当前股市行情
1、打开附件的记事本:

2、将以下代码复制粘贴到文件中(注意:股票代码sh600050,sh600018,衡痕贤伎sh600008可以自行更改为其他股票代码):stockn锾攒揉敫ames = "sh600050,sh600018,sh600008"result = GetData(stocknames)t = "股票名称 昨收盘 涨跌价(涨跌幅)" & vbTab & "最新价" & vbNewLine & " ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄" & vbNewLineFor i = 0 To UBound(result) - 1 tmp = Split(result(i), ",") x = 3 If tmp(x) = 0 Then x = 2 If tmp(x) >= tmp(2) Then jj = "+" Else jj = "-" g = tmp(0) & Chr(32) & FormatNumber(tmp(2)) & Chr(32) & jj & FormatNumber(Abs(tmp(x) - tmp(2)), , -1) & "(" & jj & FormatPercent(Abs(tmp(x) / tmp(2) - 1), , -1) & ")" & " " & vbTab & FormatNumber(tmp(x)) If i < UBound(result) Then t = t & g & vbNewLineNextCreateObject("wscript.shell").popup t, 5, "", 4096Function GetData(StockCode) Url = "http://hq.sinajs.cn/stock.php?rn=@RANDOM@&list=" & StockCode Url = GetHttp(Url) tmp = Split(Url, ";") For i = 0 To UBound(tmp) tmp(i) = Mid(tmp(i), InStr(1, tmp(i), """", vbTextCompare) + 1) If Len(tmp(i)) > 3 Then tmp(i) = Left(tmp(i), Len(tmp(i)) - 3) Next GetData = tmpEnd FunctionFunction GetHttp(Url) On Error Resume Next Set objXML = CreateObject("Microsoft.XMLHTTP") With objXML .Open "Get", Url, False, "", "" .sEnd GetHttp = .ResponseBody End With GetHttp = BytesToBstr(GetHttp, "GB2312") Set objXML = Nothing On Error GoTo 0End FunctionFunction BytesToBstr(strBody, CodeBase) Set objStream = CreateObject("Adodb.Stream") With objStream .Type = 1 .Mode = 3 .Open .Write strBody .Position = 0 .Type = 2 .Charset = CodeBase BytesToBstr = .ReadText End With objStream.Close Set objStream = NothingEnd Function

3、保存此文件,并命名为hq.vbs:

4、找到刚才保存的hq.vbs文件:

5、双击运行,即可看到股票行情:
