简体   繁体   English

配置短信API

[英]Configuring SMS API

Please all I've got this API from an SMS reseller here in Nigeria. 请大家从尼日利亚的SMS经销商那里获得此API。 I want to know how to insert my textbox values corectly API: http://smsmobile24.com/components/com_spc/smsapi.php?username=xxx&password=yyy&sender=@@sender@@&recipient=@@recipient@@&message=@@message@@ 我想知道如何核心地插入我的文本框值API: http://smsmobile24.com/components/com_spc/smsapi.php?username=xxx&password=yyy&sender=@@sender@@&recipient=@@recipient@@&message=@@message@@ ://smsmobile24.com/components/com_spc/smsapi.php?username=xxx&password=yyy&sender=@@sender@@&recipient=@@recipient@@&message http://smsmobile24.com/components/com_spc/smsapi.php?username=xxx&password=yyy&sender=@@sender@@&recipient=@@recipient@@&message=@@message@@

I need to insert password, username and of course sender and recipients. 我需要输入密码,用户名以及发送者和接收者。

I have tried doing this: 我尝试这样做:

string to, msg;
to = smsRecipientBox.Text;
msg = smsMsgBox.Text;

http://smsmobile24.com/components/com_spc/smsapi.php?username=C***er&password=fath****am&sender=Cmanager&recipient = '"+to+"'&message='"+msg+"';

But I get that red line telling me there is an error. 但是我看到那条红线告诉我这是一个错误。

You can't modify a constant value (variable that is marked with const modifier). 您不能修改常量值(用const修饰符标记的变量)。

You have two options here: 您在这里有两个选择:

1) you remove the const from the field 1)从字段中删除const

2) use formatting to insert values in placeholders in the constant string: 2)使用格式在常量字符串中的占位符中插入值:

const string url = "http://smsmobile24.com/components/com_spc/smsapi.php?username=C***er&password=fath****am&sender=Cmanager&recipient={0}&message={1}";

var to = smsRecipientBox.Text;
var msg = smsMsgBox.Text;

string result = string.Format(url, to, msg);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM