tushar aws
tushar aws

Reputation: 23

SMS sending through ASP.Net API

The SMS Service provider gave a link to send the SMS. this link I put it in my website,But In That Link I have to pass the phone Number and Price dynamically through Label. Can anyone please help Me. I am Using The Code Which is

var cli = new System.Net.WebClient();
string price = "230";
string number = "9999999999";

cli.DownloadString(@"http://bhashsms.com/api/sendmsg.php?user=ABCXYZ&pass=*****&sender=BSHSMS&phone=9999999999&text=Test SMS YOUR Order HAs Been Placed OF RS. 230 Successfully&priority=ndnd&stype=normal");

Upvotes: 0

Views: 675

Answers (1)

nozzleman
nozzleman

Reputation: 9649

Simply put the stuff at the corresponding places in the string to pass to cli.DownloadString(). This examople shows how to do so using string.Format()

var cli = new System.Net.WebClient();
string price = "230";
string number = "9999999999";

var format = @"http://bhashsms.com/api/sendmsg.php?user=ABCXYZ&pass=*****&sender=BSHSMS&phone={0}&text=Test SMS YOUR Order HAs Been Placed OF RS. {1} Successfully&priority=ndnd&stype=normal"

cli.DownloadString(string.Format(format, number, price));

Upvotes: 3

Related Questions