C#wifi共享设置上网方式如何做
C#wifi共享设置上网方式怎么做
这里是做的控制台的版本,但是我不会设置通过那个网卡上网但是我找到一个别人做好的,可是我反编译出来的东西不知道怎么打开。求大神帮助
就这个功能或者大神帮我反编译下吧
http://pan.baidu.com/share/link?shareid=1478450596&uk=537766002这个是别人做的那个软件的下载地址我放在百度盘里了。十分感谢
using System.Diagnostics;
using System;
using System.IO;
namespace ConsoleBg
{
class classOne
{
static void Main(string[] arg)
{
Console.BackgroundColor = ConsoleColor.White;
Console.ForegroundColor = ConsoleColor.Magenta;
Console.Clear();
Console.WriteLine("设置/修改 wifi共享");
Console.WriteLine("请输入您要开启wifi的SSID:");
string SSID = Console.ReadLine();
Console.WriteLine("请输入您所开启wifi的密码:");
string pwd = Console.ReadLine();
string com = string.Format("netsh wlan set hostednetwork mode=allow ssid={0} key={1}", SSID, pwd);
Console.WriteLine(create(com));
Console.WriteLine("是/否 开启:");
string output = Console.ReadLine();
if (output == "是")
create("netsh wlan start hostednetwork");
else if (output == "否")
Console.ReadLine();
else
Console.WriteLine("输入错误");
}
}
public class WlanConfig
{
public string Name { get;private set; }
public string Pwd { get;private set; }
public WlanConfig(string name, string pwd)
{
this.Name = name;
this.Pwd = pwd;
}
public string create(string com)
{
using (Process cmd = new Process())
{
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.Start();
System.Threading.Thread.Sleep(1000);
cmd.StandardInput.WriteLine(com);
cmd.StandardInput.WriteLine("exit");
string line = cmd.StandardOutput.ReadToEnd();
return line;
}
}
}
}
这里是做的控制台的版本,但是我不会设置通过那个网卡上网但是我找到一个别人做好的,可是我反编译出来的东西不知道怎么打开。求大神帮助
就这个功能或者大神帮我反编译下吧
http://pan.baidu.com/share/link?shareid=1478450596&uk=537766002这个是别人做的那个软件的下载地址我放在百度盘里了。十分感谢