日期:2014-05-17 浏览次数:21064 次
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())
&