In this tutorial i am going to explain how to create Wifi Hotspot Application with using VB.Net. Hotspot is essentially wireless access points which is providing network and Internet access where people may obtain internet access typically in public locations by using wi-fi technology.
Generally, wi-fi hotspot venues include cafes, libraries,bus station, shopping mall, airports, hotels, public area and etc.
So. Let's Understand How to Create wi-fi Hotspot Application by using Vb.Net. For that we need to follow this steps which is given below.
Step 1: Open Visual Studio.
Step 2: Go to Menubar and select File >> New >> Project.
After Select Project One Pop-Up will display now Select "Templates" and choose "Visual Basic". And From that select "Windows Forms Application" and than click on Ok.
Step 3: Design Form like:
Step 4: Now After Design You need to Write Vb.Net Code:
Vb.Net Code:
Public Class Form1 Private Sub LabelX1_Click(sender As Object, e As EventArgs) Handles LabelX1.Click End End Sub Private Sub CheckBoxX1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxX1.CheckedChanged If CheckBoxX1.CheckState = CheckState.Checked Then TextBox2.UseSystemPasswordChar = False End If If CheckBoxX1.CheckState = CheckState.Unchecked Then TextBox2.UseSystemPasswordChar = True End If End Sub Private Sub ButtonX1_Click(sender As Object, e As EventArgs) Handles ButtonX1.Click Try If TextBox1.Text = "" Then MsgBox("Hotspot name cant be empty", MsgBoxStyle.Critical) End If If TextBox2.TextLength < 8 Then MsgBox("Password should be 8+ character", MsgBoxStyle.Critical) If TextBox2.Text = "" Then MsgBox("Password cant be empty", MsgBoxStyle.Critical) End If Else Dim process As New Process() process.StartInfo.Verb = "runas" process.StartInfo.UseShellExecute = True process.Start("cmd", String.Format("/c {0} & {1} & {2}", "netsh wlan set hostednetwork mode=allow ssid=" & TextBox1.Text & " key=" & TextBox2.Text, "netsh wlan start hostednetwork", "pause")) MsgBox("Hotspot started Successfully", MsgBoxStyle.Information) End If Catch MsgBox("Failed to Establish a hotspot", MsgBoxStyle.Exclamation) End Try End Sub Private Sub ButtonX2_Click(sender As Object, e As EventArgs) Handles ButtonX2.Click Process.Start("CMD", "/C netsh wlan stop hostednetwork") MsgBox("Hotspot stoped Successfully", MsgBoxStyle.Information) End Sub Private Sub PanelEx1_Click(sender As Object, e As EventArgs) Handles PanelEx1.Click End Sub Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed Process.Start("CMD", "/C netsh wlan stop hostednetwork") End Sub End Class
Demo:
If you have any kind of question about any post, Feel free to ask.You can simply drop a comment below post. Your feedback and suggestions will be highly appreciated. ConversionConversion EmoticonEmoticon