发送多条消息 [英] sending multiple messages

查看:104
本文介绍了发送多条消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在编写用于向手机发送消息的代码.最多150个字符被发送到1条消息中.

如果用户输入的字符超过150个,则该时间消息将发送2次

(第一条消息发送1到150个字符,第二条消息发送151到300个字符).

如何编写代码来做到这一点.请为此提供解决方案.

谢谢你.



i am writing code for sending messages to mobiles.maximum 150 characters are send to 1 message.

if user enter more than 150 characters that time message send 2 times

(first message send 1 to 150 characters and 2nd message to send 151 To 300 characters).

how to write the code for do it. please give a solution for doing this.

Thank u.

推荐答案

您在这样做时面临的问题是什么.

使用循环从原始消息中获取子字符串,然后循环发送.

Whats the problem you are facing in doing that.

Use loop to get the substring from the original message, and send it in a loop.

string msg="";
int count = msg.Length;
int x = 0;
while (x <= count)
{
     string imsg = msg.Substring(x, 150);
     //TODO: Send message logic here 
     x += 150;
}



我认为这就是您所需要的. :rose:



I think this is what you required. :rose:


您是否知道如何向手机发送消息?如果没有,那么您就是在要求我们完全完成您的工作.你尝试了什么?如果是这样,您怎么不知道如何在字符串类上使用子字符串函数?
Do you know how to send a message to a mobile at all ? If not, then you''re asking us to do your work entirely. What have you tried ? If so, how can you not know how to use the substring functions on the string class ?


这篇关于发送多条消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆