I am developing an application for managing Personal Hotspot of a Laptop (Windows of Course). I'm having a little difficulty in changing the Hotspot Name. Here is my Code:
//For CMD Command
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "CMD.exe";
startInfo.CreateNoWindow = true;
//Reading User Input in textBox1:
string name = textBox1.Text;
//CMD Argument:..., Which is currently written wrong to make it Easy to
//understand the problem
startInfo.Arguments = "/C netsh wlan set hostednetwork ssid="name";
process.StartInfo = startInfo;
process.Start();
Here, In the Arguments
line, the syntax is wrong. The value assigned to Arguments
should be a single string. I need to incorporate name
, that has a dynamic value, with the rest of the string that is constant. How do I do that?