namespace SMS { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, System.EventArgs e) { string host = "199.168.6.61:9090"; string password = ""; string phone = "0169663971"; string text = "hello"; string url = string.Format( "http://{0}/sendsms?password={1}&phone={2}&text={3}", host, ("password"), // URL encode ("phone"), // URL encode ("text"), // URL encode ); WebClient client = new WebClient(); string result = client.DownloadString(url); // Success or fail? // Display result (sent or failed sent) } } }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebForm1.aspx.cs" Inherits="SMS.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Send SMS</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Mobile Number"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /> <asp:Label ID="Label2" runat="server" Text="Message"></asp:Label> <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"></asp:TextBox> <br /> <asp:Button ID="Button1" runat="server" Text="Send Sms" onclick="Button1_Click" /> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)