導航:首頁 > 板塊資金 > vb股票實時信息代碼

vb股票實時信息代碼

發布時間:2022-01-23 01:40:23

『壹』 用VB如何直接獲取股票實時數據

可以通過調用ChinaStockWebService的服務來實現獲取股票的實時數據,代碼如下:

publicstring[]getStockInfo(stringstockcode)
{

//stringurl="http://hq.sinajs.cn/list="+stockcode;
//stockcode某隻股票的代碼
stringurl="http://hq.sinajs.cn/list=sh600683";
WebClientclient=newWebClient();
client.Headers.Add("Content-Type","text/html;charset=gb2312");
Streamdata=client.OpenRead(url);
StreamReaderreader=newStreamReader(data,Encoding.GetEncoding("gb2312"));
strings=reader.ReadToEnd();
reader.Close();
data.Close();
returns.Split(',');
}

『貳』 求vb高手 做一個軟體實現股票自動買賣 我會通過另一個軟體計算買賣時間和價格,用vb實現買賣過程

這個說復雜也容易,說容易也復雜。
容易就在於演算法大家都知道,只要能實現查詢,然後根據設計需要進行交易就是了。
復雜就在於凡屬於金融領域的,不管是殺毒軟體還是防火牆,都是重點監控種類。尤其是證券公司和銀行,對於客戶沒有使用它們的終端而發生資金變動的話,那豈不是銀行或證券公司的漏洞了?
要獲得銀行的訪問許可權,你看現在的銀行主頁,一輸入密碼就需要載入什麼控制項,那就是保護措施啊。然後證券公司的訪問許可權。當然,如果你的錢全部轉到了證券公司,那隻要證券公司的許可權就可以了。

所以現在能夠實現自動買賣的軟體,都是證券公司自己寫的程序。你現在應該知道其原因了。證券公司可不會隨便讓你查詢它的檔案的。

『叄』 VB編程怎麼編個能把一個網站的即時數據載入後按我的要求計算的程序,比如導入及時股票價格

不管你用什麼編程語言,你都需要面對相同的問題:
1、導入網站數據需要網站給你提供XML服務、編程介面,這個需要問網站的管理員或者開發者;
2、如果第1條不適用,那麼你需要分析網頁的語法結構,通過規則性的字元串查找方法提取網站上的數據,這種方法就不怎麼靠譜了!

『肆』 VB如何讀取股票大盤數據,20秒更新一次,並動態的顯示到文本框中,請高手幫忙

這個要連接資料庫的。。

『伍』 我想從網頁上(比如網易、新浪)上實時抓取大盤和個股的實時行情,請給出VB的完整源碼,並加註釋。

下載遨遊瀏覽器。打開你所需要的網頁,比如新浪的大盤那裡。然後點擊瀏覽器的查看按鈕,然後其中有個查看源代碼。
就會彈出一個筆記本,然後就是你要的源代碼。
也就是所謂的數據模式啦!我剛才一直想粘貼過來我剛剛得到的。可惜網路不讓我發,不知道為什麼。你自己試下就知道了。

『陸』 VB 怎樣調出股票板塊信息

可以利用股票網頁信息

『柒』 VB 修改一個股票行情監測腳本 到了預定的股價就啟動程序a.exe

Dim file1, file2 As String
Private Sub Command1_Click()

If Val(Text1.Text) > Val(Text2.Text) Then Shell (file1)
'text2.text為大於這個值時 執行
If Val(Text1.Text) < Val(Text3.Text) Then Shell (file2)
'text3.text為小於這個值時 執行
End Sub

Private Sub Command2_Click()
WebBrowser1.Navigate "http://.hexun.com/stock/q.php?code=" & Text4.Text
End Sub

Private Sub Command3_Click()
CommonDialog1.DialogTitle = "選擇路徑"
CommonDialog1.ShowOpen
file1 = CommonDialog1.FileName
End Sub
Private Sub Command4_Click()
CommonDialog1.DialogTitle = "選擇路徑"
CommonDialog1.ShowOpen
file2 = CommonDialog1.FileName
End Sub

Private Sub Form_Load()
Timer1.Interval = 6000
End Sub

Private Sub Timer1_Timer()
WebBrowser1.Refresh
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not (pDisp Is WebBrowser1.object) Then Exit Sub
Dim wenben As String
Dim a() As String
wenben = Me.WebBrowser1.Document.Body.innerText
a = Split(wenben, vbCrLf)
Text1.Text = wenben
For i = 0 To UBound(a)
If InStr(a(i), "代碼:") > 0 And InStr(a(i), ".s") > 0 Then
Text1.Text = Right(a(i), (Len(a(i)) - InStr(a(i), ".s")) - 2)
Text5.Text = Mid(a(i), InStr(a(i), ".s") + 1, 2)
Exit For
End If
Next i
End Sub

『捌』 用VB 讀取通達信實時股票數據(現價,漲幅)

關鍵是介面

我估計現在沒有免費的介面了!!!

所以你想自己編程獲取實時數據,幾乎不可能了!!!

總之,沒有有效的網路實時數據支持,這是開源股軟的最致命的地方!!!

『玖』 vb監視程序代碼

窗體代碼: Option Explicit Dim hChangeHandle As Long Dim hWatched As Long Dim terminateFlag As Long Private Sub Form_Load() lbMsg = "Press 'Begin Watch'" End Sub Private Sub cmdEnd_Click() If hWatched > 0 Then Call WatchDelete(hWatched) Unload Me Set Form1 = Nothing End Sub Private Sub cmdStop_Click() 'clean up by deleting the handle to the watched directory Call WatchDelete(hWatched) hWatched = 0 cmdBegin.Enabled = True lbMsg = "Press 'Begin Watch'" End Sub Private Sub cmdBegin_Click() Dim r As Long Dim watchPath As String Dim watchStatus As Long watchPath = "c:\bat" terminateFlag = False cmdBegin.Enabled = False lbMsg = "Using Explorer and Notepad, create, modify, rename, delete or " lbMsg = lbMsg & "change the attributes of a text file in the watched directory.""" 'get the first file text attributes to the listbox (if any) WatchChangeAction watchPath 'show a msgbox to indicate the watch is starting MsgBox "Beginning watching of folder " & watchPath & " .. press OK" 'create a watched directory hWatched = WatchCreate(watchPath, FILE_NOTIFY_FLAGS) 'poll the watched folder watchStatus = WatchDirectory(hWatched, 100) 'if WatchDirectory exited with watchStatus = 0, 'then there was a change in the folder. If watchStatus = 0 Then 'update the listbox for the first file found in the 'folder and indicate a change took place. WatchChangeAction watchPath MsgBox "The watched directory has been changed. Resuming watch..." '(perform actions) 'this is where you'd actually put code to perform a 'task based on the folder changing. 'FindNextChangeNotification API, again exiting if 'watchStatus indicates the terminate flag was set Do watchStatus = WatchResume(hWatched, 100) If watchStatus = -1 Then 'watchStatus must have exited with the terminate flag MsgBox "Watching has been terminated for " & watchPath Else: WatchChangeAction watchPath MsgBox "The watched directory has been changed again." '(perform actions) 'this is where you'd actually put code to perform a 'task based on the folder changing. End If Loop While watchStatus = 0 Else 'watchStatus must have exited with the terminate flag MsgBox "Watching has been terminated for " & watchPath End If End Sub Private Function WatchCreate(lpPathName As String, flags As Long) As Long 'FindFirstChangeNotification members: ' ' lpPathName: folder to watch ' bWatchSubtree: ' True = watch specified folder and its sub folders ' False = watch the specified folder only ' flags: OR'd combination of the FILE_NOTIFY_ flags to apply WatchCreate = FindFirstChangeNotification(lpPathName, False, flags) End Function Private Sub WatchDelete(hWatched As Long) Dim r As Long terminateFlag = True DoEvents r = FindCloseChangeNotification(hWatched) End Sub Private Function WatchDirectory(hWatched As Long, interval As Long) As Long 'Poll the watched folder. 'The Do..Loop will exit when: ' r = 0, indicating a change has occurred ' terminateFlag = True, set by the WatchDelete routine Dim r As Long Do r = WaitForSingleObject(hWatched, interval) DoEvents Loop While r <> 0 And terminateFlag = False WatchDirectory = r End Function Private Function WatchResume(hWatched As Long, interval) As Boolean Dim r As Long r = FindNextChangeNotification(hWatched) Do r = WaitForSingleObject(hWatched, interval) DoEvents Loop While r <> 0 And terminateFlag = False WatchResume = r End Function Private Sub WatchChangeAction(fPath As String) Dim fName As String List1.Clear fName = Dir(fPath & "\" & "*.*") If fName > "" Then List1.AddItem "path: " & vbTab & fPath List1.AddItem "file: " & vbTab & fName List1.AddItem "size: " & vbTab & FileLen(fPath & "\" & fName) List1.AddItem "attr: " & vbTab & GetAttr(fPath & "\" & fName) End If End Sub 模塊代碼: Option Explicit Public Const INFINITE = &HFFFF Public Const FILE_NOTIFY_CHANGE_FILE_NAME As Long = &H1 Public Const FILE_NOTIFY_CHANGE_DIR_NAME As Long = &H2 Public Const FILE_NOTIFY_CHANGE_ATTRIBUTES As Long = &H4 Public Const FILE_NOTIFY_CHANGE_SIZE As Long = &H8 Public Const FILE_NOTIFY_CHANGE_LAST_WRITE As Long = &H10 Public Const FILE_NOTIFY_CHANGE_LAST_ACCESS As Long = &H20 Public Const FILE_NOTIFY_CHANGE_CREATION As Long = &H40 Public Const FILE_NOTIFY_CHANGE_SECURITY As Long = &H100 Public Const FILE_NOTIFY_FLAGS = FILE_NOTIFY_CHANGE_ATTRIBUTES Or _ FILE_NOTIFY_CHANGE_FILE_NAME Or _ FILE_NOTIFY_CHANGE_LAST_WRITE Declare Function FindFirstChangeNotification Lib "kernel32" _ Alias "FindFirstChangeNotificationA" _ (ByVal lpPathName As String, _ ByVal bWatchSubtree As Long, _ ByVal dwNotifyFilter As Long) As Long Declare Function FindCloseChangeNotification Lib "kernel32" _ (ByVal hChangeHandle As Long) As Long Declare Function FindNextChangeNotification Lib "kernel32" _ (ByVal hChangeHandle As Long) As Long Declare Function WaitForSingleObject Lib "kernel32" _ (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long Public Const WAIT_OBJECT_0 = &H0 Public Const WAIT_ABANDONED = &H80 Public Const WAIT_IO_COMPLETION = &HC0 Public Const WAIT_TIMEOUT = &H102 Public Const STATUS_PENDING = &H103

『拾』 如何在VB6.0中根據設置的時間查詢股票的數據,急急急。。。

不可以設置

閱讀全文

與vb股票實時信息代碼相關的資料

熱點內容
有友股票開盤漲幾個漲停板 瀏覽:879
創業板的股票虧幾年直接退市 瀏覽:37
股票賬戶11點轉出什麼時候到賬 瀏覽:534
怎麼買前一天漲停的股票 瀏覽:70
證券公司買賣自己股票 瀏覽:109
百度離職員工股票窗口期嗎 瀏覽:532
智能家居控制系統股票 瀏覽:616
投資股票應注意的問題 瀏覽:203
瑞銀舉牌金風科技股票 瀏覽:28
平安證券app低股票交易 瀏覽:838
香港最新股票電影 瀏覽:185
2019年要重組的股票 瀏覽:448
st股票退市有哪幾種情形 瀏覽:463
中國石油節日多少錢股票 瀏覽:105
長期持有工行股票 瀏覽:104
面臨被ST的股票怎麼辦 瀏覽:72
增長多資產配置組合股票實情 瀏覽:395
股票余額和資產這些啥意思 瀏覽:841
甘咨詢股票走勢 瀏覽:782
歷史上99年退市的股票 瀏覽:776