") && sr.ReadLine ().Trim () == "
{") {
stringBuilder = new StringBuilder ();
stringBuilder.AppendLine ("{");
}
} else {
if (line.EndsWith ("
")) {
stringBuilder.AppendLine ("}");
string s = @stringBuilder.ToString ().Replace (",}", "}").Replace ("\"content\": []", "\"content\": \"\"");
airable = Newtonsoft.Json.JsonConvert.DeserializeObject
(@s);
break;
} else {
if (line.Contains ("")) {
line = line.Remove (line.IndexOf ("") - line.IndexOf ("", "");
}
stringBuilder.AppendLine (@line);
}
}
}
} catch { } finally {
if (sr != null)
sr.Close ();
}
return airable;
}
///
/// 获取当前播放的列表
///
string getUSBPlayList ()
{
StringBuilder getPlayList = new StringBuilder ();
getPlayList.AppendLine ("");
getPlayList.AppendLine ("");
getPlayList.AppendLine ("");
getPlayList.AppendLine ("USBDiskQueue");
getPlayList.AppendLine ("");
getPlayList.AppendLine ("");
getPlayList.AppendLine ("");
Shared.Net.MyWebClient webClient = new Shared.Net.MyWebClient ();
webClient.Headers.Add ("SOAPACTION", "\"urn:schemas-wiimu-com:service:PlayQueue:1#BrowseQueue\"");
webClient.Headers.Add ("CONTENT-TYPE", "text/xml; charset=\"utf-8\"");
try {
byte [] recevieBytes = webClient.UploadData (new Uri ("http://" + A31MusicModel.Current.IPAddress + ":" + A31MusicModel.Current.Port + "/upnp/control/PlayQueue1"), "POST", System.Text.Encoding.UTF8.GetBytes (getPlayList.ToString ()));
return System.Text.Encoding.UTF8.GetString (recevieBytes, 0, recevieBytes.Length);
} catch { }
return null;
}
}
}