Ajit_Kr
asked on
Convert a Stream Object to File Stream In Silverlight
i am getting an audio file from server in silver light application. I am getting stream in a Stream object. I need to convert this is into "filestream". Is there is any solution to do this. Please help me out.
Here is the code.
string UrlString = SongURL
HttpWebRequest request = (HttpWebRequest)HttpWebReq uest.Creat e(new Uri(UrlString));
request.BeginGetResponse(n ew AsyncCallback(ReadCallback ), request);
private void ReadCallback(IAsyncResult asynchronousResult)
{
this.Dispatcher.BeginInvok e(delegate ()
{
HttpWebRequest request =
(HttpWebRequest)asynchrono usResult.A syncState;
HttpWebResponse response =
(HttpWebResponse)request.E ndGetRespo nse(asynch ronousResu lt);
//using (StreamReader streamReader1 =
// new StreamReader(response.GetR esponseStr eam()))
//{
// string resultString = streamReader1.ReadToEnd();
// // resultBlock.Text = "Using HttpWebRequest: " + resultString;
//}
Stream streamReader1 = response.GetResponseStream ();
}
Here is the code.
string UrlString = SongURL
HttpWebRequest request = (HttpWebRequest)HttpWebReq
request.BeginGetResponse(n
private void ReadCallback(IAsyncResult asynchronousResult)
{
this.Dispatcher.BeginInvok
{
HttpWebRequest request =
(HttpWebRequest)asynchrono
HttpWebResponse response =
(HttpWebResponse)request.E
//using (StreamReader streamReader1 =
// new StreamReader(response.GetR
//{
// string resultString = streamReader1.ReadToEnd();
// // resultBlock.Text = "Using HttpWebRequest: " + resultString;
//}
Stream streamReader1 = response.GetResponseStream
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ss
ASKER
In silverlight file class doesn't have WriteAllBytes() method..
Please suggest more.