Private Function 硬盤序列號(hào)() As String
專業(yè)從事成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè),高端網(wǎng)站制作設(shè)計(jì),微信平臺(tái)小程序開發(fā),網(wǎng)站推廣的成都做網(wǎng)站的公司。優(yōu)秀技術(shù)團(tuán)隊(duì)竭力真誠(chéng)服務(wù),采用H5開發(fā)+CSS3前端渲染技術(shù),成都響應(yīng)式網(wǎng)站建設(shè)公司,讓網(wǎng)站在手機(jī)、平板、PC、微信下都能呈現(xiàn)。建站過程建立專項(xiàng)小組,與您實(shí)時(shí)在線互動(dòng),隨時(shí)提供解決方案,暢聊想法和感受。
Try
Dim myInfo As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 1\Target Id 0\Logical Unit Id 0")
硬盤序列號(hào) = Trim(myInfo.GetValue("SerialNumber"))
Catch
Try
Dim myInfo As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("HARDWARE\DEVICEMAP\Scsi\Scsi Port 1\Scsi Bus 1\Target Id 0\Logical Unit Id 0")
硬盤序列號(hào) = Trim(myInfo.GetValue("SerialNumber"))
Catch
硬盤序列號(hào) = ""
End Try
End Try
End Function
試下,如果返回為空,則表示失敗。
在本機(jī)win8win8.1有效,不過好像在有些機(jī)器上沒用。
Private?Sub?Form1_KeyPress(ByVal?sender?As?Object,?ByVal?e?As?System.Windows.Forms.KeyPressEventArgs)?Handles?Me.KeyPress
If?Asc(0)?Then
textbox1.text="0"
end?if
end?sub
1-126為英文字符等
33088-41214是漢字(按拼音排序)
41378-41982是各種字符
42145-42993是其它國(guó)家字符(日、俄、韓、希臘等)
43072-43157是符號(hào)
43169-43508是漢語拼音相關(guān)及一些符號(hào)
43584-65184是漢字(按部首排序)
你可以運(yùn)行下面程序代碼:
Private Sub Command1_Click()
Open "c:\zf.txt" For Append As #1
For i = 1 To 65535
Print #1, i, ": "; Chr(i)
Next i
Close #1
End Sub
只需不到一秒,所有字符就會(huì)形成一個(gè)文件zf.txt放到c盤根目錄下。
更多VB代碼請(qǐng)關(guān)注我的博客:
Dim url As String=" 網(wǎng)址"
Dim httpReq As System.Net.HttpWebRequest
Dim httpResp As System.Net.HttpWebResponse
Dim httpURL As New System.Uri(url)
httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)
httpReq.Method = "GET"
httpResp = CType(httpReq.GetResponse(), HttpWebResponse)
httpReq.KeepAlive = False ' 獲取或設(shè)置一個(gè)值,該值指示是否與
Internet資源建立持久連接。
Dim reader As StreamReader = _
New StreamReader(httpResp.GetResponseStream,
System.Text.Encoding.GetEncoding(-0))
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是網(wǎng)頁(yè)源代碼