Take the 2-minute tour ×

when i down load the two same link like those a link! and http://files.sparklingclient.com/099_2010.07.09_WP7_Phones_In_The_Wild.mp3 they all can be downloded by IE .but when i download in wp7 the laster can be downloaded the first show an error ""The remote server returned an error: NotFound."" i don't konw why .is webURL is not suited for wp7?

private void Button_Click(object sender, RoutedEventArgs e)
    stringUri = "http://upload16.music.qzone.soso.com/30828161.mp3";
  //stringUri = "http://files.sparklingclient.com/079_2009.08.20_ElementBinding.mp3";
    Uri uri = new Uri(stringUri, UriKind.Absolute);            
private void GetMusic(Uri uri)
    request = WebRequest.Create(uri) as HttpWebRequest;
    request.Method = "Post";
    string header= request.Accept;
    request.BeginGetResponse(new AsyncCallback(GetAsynResult),request);

void GetAsynResult(IAsyncResult result)

    HttpWebResponse reponse = request.EndGetResponse(result) as HttpWebResponse;
    if (reponse.StatusCode == HttpStatusCode.OK)

       Stream stream=reponse.GetResponseStream();
       SaveMusic(stream, "music");
           () =>
               me.AutoPlay = true;
               me.Volume = 100;
               songStream.Position = 0;

protected void SaveMusic(Stream stream,string name)

            IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
            if (!fileStorage.DirectoryExists("Source/Music"))
            using (IsolatedStorageFileStream fileStream = IsolatedStorageFile.GetUserStoreForApplication().OpenFile("Source\\Music\\" + name + ".mp3", FileMode.Create))
                byte[] bytes = new byte[stream.Length];
                stream.Read(bytes, 0, bytes.Length);
                fileStream.Write(bytes, 0, bytes.Length);

protected void ReadMusic(string name)

        using (IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication())
            songStream = null;
            songStream = new IsolatedStorageFileStream("Source\\Music\\" + name + ".mp3", FileMode.Open, fileStorage);                  


share|improve this question
You should stop using Google Translate for your questions. –  Claus Jørgensen - MSFT Jul 26 '11 at 7:12
thanks for yor advice ,next time i will use bing translator;or you can help me –  张传龙 Jul 26 '11 at 9:27
add comment

2 Answers

Please try to change

request.Method = "Post" 


request.Method = "Get" 
share|improve this answer
+1 Well spotted! It should actually be GET (uppercase), though, for compatibility. –  Richard Szalay Jul 26 '11 at 8:37
add comment

If you are running into this problem on the emulator, have you tried running Fiddler? It will intercept the HTTP requests and you can see if the call being made to the server is the one you expect.

Remember to close/reopen the emulator after you start Fiddler so that it will pick up the proxy.

The NotFound response can also occur with bad SSL certificates. That doesn't appear to be related to your problem, but something to keep in mind.

share|improve this answer
add comment

Your Answer


