vb.net源码 vbnet源码 免费下载

VB程序源码如何使用vb.net源码你需要安装vb6.0开发软件
如果安装vb.net源码了,就可以直接打开源码测试了,后缀名是vbp,(就是vb的工程文件)
如果没有安装vb6.0,还想打开源码看程序 , 那就右击 用记事本 打开后缀名为frm的文件,vb.net源码他是vb的窗口文件,源码都在vb.net源码他里面
一般得源码是没有生成exe可执行文件的,那样文件太多,太大,浪费空间
如果你自己想生成exe可执行文件 , 那就vb6.0得文件菜单中把文件保存成exe可执行文件就可以了 , 非常简单
好运vb.net源码!
vb.net源代码如何生成exe格式vb.net编译出来的exe只有依赖.net
framework才能运行
但有一些第三方工具可以用来把exe用到的assembly和dll打包成一个exe文件,不过这样的结果就是exe体积非常大
比如.netz工具,它的官方地址:
使用很简单,比如你的exe文件是a.exe,直接netz
a.exe就可以把a和它用到的.net代码一起打包成一个exe
请问为什么我公司的vb.net源码到了我的电脑上运行就会显示好多未声明?。?/h2>用API 函数GetVolumeInformation得到的不是硬盘的序列号?。。?
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName,
LPTSTR lpVolumeNameBuffer,
DWORD nVolumeNameSize,
LPDWORD lpVolumeSerialNumber,
【vb.net源码 vbnet源码 免费下载】LPDWORD lpMaximumComponentLength,
LPDWORD lpFileSystemFlags,
LPTSTR lpFileSystemNameBuffer,
DWORD nFileSystemNameSize
);
看看英文啊vb.net源码:VolumeSerialNumber!得到的只是卷区序列号!
硬盘的序列号应该是
Drive Model Number________________: WDC WD400EB-00CPF0
Drive Serial Number_______________: WD-WCAATF083586
Drive Controller Revision Number__: 06.04G06
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 40020664320 bytes
中:
Drive Serial Number_______________: WD-WCAATF083586 这才是硬盘Serial Number?。。。?
这个号是不会因为vb.net源码你格式化硬盘而改动vb.net源码,也不是网上流传的修改工具能改的,(其实网上流传的修改工具的也不过是卷区号而已?。?
建议用 DiskID.dll或DiskID32.dll来获取
用diskid.dll和disk32.dll获得硬盘序列号
1.调用diskid.dll实现:
Option Explicit
Private Declare Function IsWinNT Lib "DiskID.DLL" () As Long
Private Declare Function ReadPhysicalDrive9X Lib "DiskID.DLL" (driveID As Long, buffer As Long, bufLen As Long) As Long
Private Declare Function ReadPhysicalDriveInNT Lib "DiskID.DLL" (driveID As Long, buffer As Long, bufLen As Long) As Long
Private Type DRIVER_INFO_OK
ModalNumber(39) As Byte
SerialNumber(19) As Byte
ControlNum(7) As Byte
DriveType As Long
Cylinders As Long
Heads As Long
Sectors As Long
End Type
Private Sub Command1_Click()
Dim x As DRIVER_INFO_OK
Dim i As Long
If IsWinNT = 1 Then
i = ReadPhysicalDriveInNT(ByVal 0, ByVal VarPtr(x), ByVal 256)
Else
i = ReadPhysicalDrive9X(ByVal 0, ByVal VarPtr(x), ByVal 256)
End If
Dim s As String
s = StrConv(x.ModalNumber, vbUnicode)
s = Left(s, InStr(1, s, Chr(0)) - 1)
MsgBox "硬件厂商代码为:"s
s = StrConv(x.SerialNumber, vbUnicode)
s = Left(s, InStr(1, s, Chr(0)) - 1)
MsgBox "硬盘序列号为:"s
End Sub
2.调用diskid32.dll实现:
Option Explicit
Private Declare Function DiskID32 Lib "DiskID32.DLL" (ByRef DiskModel As Byte, ByRef DiskID As Byte) As Long
Private Sub Command1_Click()
Dim DiskModel(31) As Byte, DiskID(31) As Byte, i As Integer, Model As String, ID As String
If DiskID32(DiskModel(0), DiskID(0))1 Then
MsgBox "get diskid32 err"
Exit Sub
End If
For i = 0 To 31
If Chr(DiskModel(i))Chr(0) Then
Model = ModelChr(DiskModel(i))
End If
If Chr(DiskID(i))Chr(0) Then
ID = IDChr(DiskID(i))
End If
Next
MsgBox "硬件产生代码为:"Model
MsgBox "硬盘序列号为:"ID
End Sub
说明:diskid.dll可从下载
diskid32.dll可从下载
如何用vb.net获得网页的源代码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就是网页源代码
vb.net源码的介绍就聊到这里吧,感谢你花时间阅读本站内容 , 更多关于vbnet源码 免费下载、vb.net源码的信息别忘了在本站进行查找喔 。

    推荐阅读