1
我從我的web應用程序發送一個短信,這是建立在ASP.NET C#但由於某種原因,當我添加SourceAddress
與parameter.Add("SourceAddress", "BPD.co.uk");
工作BPD.co.uk
來通過爲BPDcouk
。點消失在短信源地址
如何讓點出現?
繼承人我的C#代碼:
public void SendSms(string MobileNumber, string SMSContent)
{
Dictionary<string, string> parameter = new Dictionary<string, string>();
parameter.Add("Action", "Send");
parameter.Add("DestinationAddress", MobileNumber);
parameter.Add("SourceAddress", "BPD.co.uk");
parameter.Add("Body", SMSContent);
parameter.Add("ValidityPeriod", "86400");
string resultcode = api_connect("nsp04456", "pword", parameter);
}
繼承人
private string api_connect(string Username, string Password, Dictionary<string, string> ParametersDict)
{
string url = "http://api.sms.co.uk/api/api.php";
string poststring = "Username=" + Username + "&";
poststring = poststring + "Password=" + Password;
// Turn the parameter dictionary object into the variables
foreach (KeyValuePair<string, string> item in ParametersDict)
{
poststring = poststring + "&" + item.Key + "=" + item.Value;
}
MSXML2.ServerXMLHTTP60 xmlHttp = new MSXML2.ServerXMLHTTP60();// Server.CreateObject("MSXML2.ServerXMLHTTP.4.0");
xmlHttp.open("POST", url, false);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(poststring);
return xmlHttp.responseText;
}
這會將「BPD.co.uk」添加到字典中......之後會發生什麼取決於「api_connect」的功能以及您調用的具體API – 2012-04-17 10:46:09
添加了API函數 – 2012-04-17 10:48:35