We can create a shortcut to an .exe
file.
As you know, shortcut files can contain parameters.
I want to build a program that automatically assigns parameters using C #
code.
Here is my code:
private void button4_Click(object sender, EventArgs e)
{
HttpWebRequest req =
WebRequest.Create("http://test.com/contact_ip.txt") as HttpWebRequest;
HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
using (StreamReader sr = new StreamReader(resp.GetResponseStream()))
{
string ResponseText = sr.ReadToEnd();
//ResponseText
System.Diagnostics.Process.Start(".\\folder\\test.exe");
// e.g.)) test.exe 127.0.0.1(ResponseText) 1234(port)
}
}
How do I include the IP address and port at test.exe
?
e.g.)) .\folder\test.exe 127.0.0.1 4455
e.g.2)) Var ResponseText = ip Address
You can try this: