/// <summary>
/// 回复音乐内容
/// </summary>
/// <param name="to">接收者</param>
/// <param name="from">消息来源</param>
/// <param name="title">标题</param>
/// <param name="description">描述信息</param>
/// <param name="musicurl">音乐链接</param>
/// <param name="hqmusicurl">高质量音乐链接,WIFI环境优先使用该链接播放音乐</param>
/// <returns>生成的输出文本</returns>
public string ResponseMusicMsg( string title, string description, string musicurl, string hqmusicurl)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat( "<xml>" );
sb.AppendFormat( "<ToUserName><![CDATA[{0}]]></ToUserName>" , clientUser);
sb.AppendFormat( "<FromUserName><![CDATA[{0}]]></FromUserName>" , serverUser);
sb.AppendFormat( "<CreateTime>{0}</CreateTime>" , DateTime.Now.Ticks.ToString());
sb.AppendFormat( "<MsgType><![CDATA[music]]></MsgType>" );
sb.AppendFormat( "<Music>" );
sb.AppendFormat( " <Title><![CDATA[{0}]]></Title>" , title);
sb.AppendFormat( " <Description><![CDATA[{0}]]></Description>" , description);
sb.AppendFormat( " <MusicUrl><![CDATA[{0}]]></MusicUrl>" , musicurl);
sb.AppendFormat( " <HQMusicUrl><![CDATA[{0}]]></HQMusicUrl>" , hqmusicurl);
sb.AppendFormat( " <FuncFlag>0</FuncFlag>" );
sb.AppendFormat( "</Music>" );
sb.AppendFormat( "</xml>" );
return sb.ToString();
}
|