如何用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 ' 获取或设置一个值vb.net源码,该值指示是否与
Internet资源建立持久连接 。
Dim reader As StreamReader = _
New StreamReader(httpResp.GetResponseStream,
System.Text.Encoding.GetEncoding(-0))
Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码
vb.net如何实现打印DataGridView1里的内容,求源码使用 PrintDocument 控件的 Print() 方法可以打印指定对象中的内容,参考代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim bm As New Bitmap(Me.DataGridView1.Width, Me.DataGridView1.Height)
DataGridView1.DrawToBitmap(bm, New Rectangle(0, 0, Me.DataGridView1.Width, Me.DataGridView1.Height))
e.Graphics.DrawImage(bm, 0, 0)
End Sub
VB程序源码如何使用你需要安装vb6.0开发软件
如果安装了,就可以直接打开源码测试了,后缀名是vbp,(就是vb的工程文件)
如果没有安装vb6.0 , 还想打开源码看程序 , 那就右击 用记事本 打开后缀名为frm的文件,他是vb的窗口文件,源码都在他里面
一般得源码是没有生成exe可执行文件的,那样文件太多,太大,浪费空间
如果你自己想生成exe可执行文件,那就vb6.0得文件菜单中把文件保存成exe可执行文件就可以了 , 非常简单
好运!
vb.net源代码如何生成exe格式vb.net编译出来的exe只有依赖.net
framework才能运行
但有一些第三方工具可以用来把exe用到的assembly和dll打包成一个exe文件vb.net源码,不过这样的结果就是exe体积非常大
比如.netz工具,它的官方地址vb.net源码:
使用很简单,比如vb.net源码你的exe文件是a.exe,直接netz
a.exe就可以把a和它用到的.net代码一起打包成一个exe
请问为什么我公司的vb.net源码到了我的电脑上运行就会显示好多未声明?。?/h2>用API 函数GetVolumeInformation得到的不是硬盘的序列号?。。?
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName,
LPTSTR lpVolumeNameBuffer,
DWORD nVolumeNameSize,
LPDWORD lpVolumeSerialNumber,
LPDWORD lpMaximumComponentLength,
LPDWORD lpFileSystemFlags,
LPTSTR lpFileSystemNameBuffer,
DWORD nFileSystemNameSize
);
看看英文?。篤olumeSerialNumber!得到的只是卷区序列号!
硬盘的序列号应该是
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?。。。?
这个号是不会因为你格式化硬盘而改动,也不是网上流传的修改工具能改的,(其实网上流传的修改工具的也不过是卷区号而已?。?
建议用 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源码 vb源代码合集】关于vb.net源码和vb源代码合集的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- 投屏神器下载,投屏神器下载免费
- 手机拍视频使用什么软件,手机拍视频什么软件高清
- 换了cpu为什么要f1,为什么换了cpu之后温度高
- 什么软件让直播美颜,什么软件直播美颜效果最好
- java调色代码 javacolor颜色
- go语言swig,go语言和java哪个更有前途
- 阿里服务器如何设置分机,阿里云分布式服务器
- 模拟器中国制造卡车游戏,我想看中国卡车模拟
- php大数据分页慢 大数据量的分页查询怎么优化