vendredi 27 juin 2014

How to create wifi adhoc


Vote count:

0




I need create wifi ad-hoc using visual c#. i tried to do it using below code. but it doesn't work. how can i correct it?


Thanks.



private void button5_Click(object sender, EventArgs e)
{
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C netsh wlan set hostednetwork mode=allow ssid=HotSpot key=12345678";
startInfo.Verb = "runas";
startInfo.UseShellExecute = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo = startInfo;
process.Start();

Process wifiStart = new Process();
ProcessStartInfo wifiStartInfo = new ProcessStartInfo();
wifiStartInfo.FileName = "netsh.exe";
wifiStartInfo.Arguments = "/C wlan start hostednetwork";
wifiStartInfo.Verb = "runas";
wifiStartInfo.UseShellExecute = true;
wifiStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo = wifiStartInfo;
wifiStart.Start();
}


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire