阅读全文:http://www.cckan.net/forum.php?mod=viewthread&tid=170
先看看方法吧,很简单的方法

Code
/// <summary>
/// 取字符的方法
/// </summary>
/// <param name="sourceStr">源字符串</param>
/// <param name="strOf">变量名称</param>
/// <returns>返回变量后面的值</returns>
private string smsindexOf(string sourceStr, string strOf)
{
sourceStr = sourceStr.Substring(sourceStr.IndexOf(strOf + "="), sourceStr.Length - sourceStr.IndexOf(strOf + "=") - 6);
sourceStr = sourceStr + "&";
sourceStr = sourceStr.Substring(sourceStr.IndexOf("=") + 1, sourceStr.IndexOf("&") - sourceStr.IndexOf("=") - 1);
return sourceStr;
}
下在是使用方法
示例字符
result=0&des=OK&mobile=13167507389&content=123&recvtime=2009-1-1 12:00:00&mobile=13167507389&content=123&recvtime=2009-2-2 12:00:00
//消息的描述
if (strsms.IndexOf("des=") >= 0)
{
string strSms = smsindexOf(strsms, "des");
}
本人的博客不再维护从2013年就不再维护了
需要我帮助的朋友请到我的个人论坛 http://www.sufeinet.com 进行讨论,感谢大家对我的支持!