我有一个 url,可以向提供的手机号码发送短信。我只想从 Windows 应用程序调用此 url,而不是在浏览器中打开。我只想从我的 Windows 应用程序执行该 url。
网址示例
http://mycompany.com/sms.aspx?mobilenum=9123444777&Message=this is a test message
我试过这种方法。但是它是在浏览器中打开的。 我不想在浏览器中打开它。我只想在内部执行这一行。
System.Diagnostics.ProcessStartInfo sInfo = new
System.Diagnostics.ProcessStartInfo("http://mycompany.com
/sms.aspx?mobilenum=9123444777&Message=this is a test message");
System.Diagnostics.Process.Start(sInfo);
谢谢。
最佳答案
您是否尝试过使用 HttpWebRequest ?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"http://mycompany.com/sms.aspx?mobilenum=9123444777&Message=this%20is%20a%20test%20message");
WebResponse response = request.GetResponse();
response.Close();
关于c# - 从 C# Windows 应用程序调用 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27797377/