大家好,
我正在尝试使用SMS API。从我的角度来看,一切都很好,但SMS没有发送。如果我直接在浏览器上使用URL,它将执行。
或者我如何构建字符串有什么问题?下面是代码。
请注意cbo.Title是一个comobox,txtFirstname是一个Textbox。
public void NewText()
{
string username = "something@gmail.com";
string password = "Password";
string urlStr;
string message=" Dear " + cbo_Title.Text + " " + txt_FirstName.Text + ", Your New Savings Account Number is " + Account_No + ".Welcome to AGENTKUNLE Global Services. Your Future is Our Priority ";
string sender = "AGENTKUNLE";
string recipient=txt_Phone.Text;
urlStr = "https://portal.nigeriabulksms.com/api/?username="+username+"+password="+password+"+sender="+sender+"+message="+message+"+ mobiles="+recipient;
Uri success = new Uri(urlStr);
}
您从未提出请求。
Uri
对象只是uri的容器(请参见Microsoft Docs)。如果要发送请求,请签出HttpClient类。