处理Message,Message Part的Helper方法

//String of Message Body part
public static string GetStringFromBTSMessageBody(XLANGMessage btsMessage)
{
  string result;
  StreamReader reader = new StreamReader((Stream)btsMessage[0].RetrieveAs(typeof(Stream)));
  result = reader.ReadToEnd();
  reader.Close();
  return result;
}

Or
public static string GetStringFromBTSMessageBody(XLANGMessage btsMessage)
{
  string result;
  StreamReader reader = new StreamReader((Stream)btsMessage[0].RetrieveAs(typeof(Stream)));
  result = reader.ReadToEnd();
  reader.Close();
  return result;
}

你可能感兴趣的:(message)