Private Function 硬盘序列号() As String
专业从事成都网站制作、网站建设、外贸网站建设,高端网站制作设计,微信平台小程序开发,网站推广的成都做网站的公司。优秀技术团队竭力真诚服务,采用H5开发+CSS3前端渲染技术,成都响应式网站建设公司,让网站在手机、平板、PC、微信下都能呈现。建站过程建立专项小组,与您实时在线互动,随时提供解决方案,畅聊想法和感受。
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")
硬盘序列号 = 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")
硬盘序列号 = Trim(myInfo.GetValue("SerialNumber"))
Catch
硬盘序列号 = ""
End Try
End Try
End Function
试下,如果返回为空,则表示失败。
在本机win8win8.1有效,不过好像在有些机器上没用。
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是其它国家字符(日、俄、韩、希腊等)
43072-43157是符号
43169-43508是汉语拼音相关及一些符号
43584-65184是汉字(按部首排序)
你可以运行下面程序代码:
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
只需不到一秒,所有字符就会形成一个文件zf.txt放到c盘根目录下。
更多VB代码请关注我的博客:
Dim url As String=" 网址"
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 ' 获取或设置一个值,该值指示是否与
Internet资源建立持久连接。
Dim reader As StreamReader = _
New StreamReader(httpResp.GetResponseStream,
System.Text.Encoding.GetEncoding(-0))
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码