Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
webform1.aspx.cs
C#
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)




        }
    }
}


webform1.aspx

XML
<%@ 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>
        &nbsp;&nbsp;
        <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"></asp:TextBox>
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Send Sms"
            onclick="Button1_Click" />
    </div>
    </form>
</body>
</html>
Posted
Comments
Ron Beyer 15-Dec-13 22:28pm    
Do you have some kind of question?
So, what is the problem?
Member 10468367 16-Dec-13 21:53pm    
the comment there. i dont know how to -
>encode password, phone, text into url
>how to display the message when it is success and fail.
> how to display the status of the result.
> how to generate code for password reset.
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900