vb建无线wifi热点(附图)
本程序是利用vb读写文件来实现的,再通过调用计算机中的explorer运行新建的文件,程序思想是通过dos命令建立虚拟无线热点,因此你的计算机必须要求带无线网卡,如果你的计算机有无线网卡但不能运行,请尝试升级网卡驱动。由于运行当中会调用explorer程序,和某些计算机病毒的投放方法有所相同,所以程序在运行时会引起一些安全软件的误判。程序运行时会在C:\\Users\\Administrator\\Documents目录下生成文件。原程序已上传到我的百度网盘上http://pan.http://www.wodefanwen.com//netdisk/singlepublic?fid=52019_1022037011 还有许多不足,希望大家指出改进!
程序源码如下:
Public a As Integer, e As Integer, f As Integer, b As String, c As String, d As String Private Sub Command2_Click() b = Text1.Text c = Text2.Text
d = \If b = \
MsgBox \请填写新建无线网络名称或密码!\错误!\Else
If Len(c) = 8 Then
Open \Print #1, \Print #1, \Close #1
Shell \Label5.Caption = \已连接\Timer1.Enabled = True Else
MsgBox \密码长度应为8位!\错误!\End If End If End Sub
Private Sub Command3_Click()
If Dir(\Open \Print #1, \
Shell \Close #1
Timer1.Enabled = False Else
MsgBox \您还没有创建wifi热点!\错误!\End If End Sub
Private Sub Form_Load() a = 0 e = 0 f = 0 End Sub
Private Sub Form_Unload(Cancel As Integer)
If Dir(\Kill \End If
If Dir(\Kill \End If End Sub
Private Sub Option1_Click() Text2.PasswordChar = \End Sub
Private Sub Option2_Click() Text2.PasswordChar = \End Sub
Private Sub Timer1_Timer() r: a = a + 1 If a = 60 Then e = e + 1 a = -1 GoTo r End If
If e = 60 Then f = f + 1 e = 0 End If
Label6.Caption = f & \小时\分钟\秒\End Sub
附图:
1.未连接
2.已连接
3.
4.打开网络和共享中心——》更改适配器设置,会发现多了个无线网络连接2
5.设置宽带共享
之后你就可以用你的手机连接你的电脑共享网络上网,再也不怕月末流量报警
了有木有! 注意:
程序运行点击创建wifi时会出现如下情况
点允许执行就行了,我试过用cmd.exe直接打开新建的文件,好像不行,所以只能用explorer了。