2012-05-09 11 views

答えて

0

ます。public void GetImages()

(IsolatedStorageFileのISFを= IsolatedStorageFile.GetUserStoreForApplication())を使用して
{ 

      WebClient m_webClient = new WebClient(); 

      Uri m_uri = new Uri("http://localhost/Images/Map.png"); 

      m_webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_OpenReadCompleted); 

      m_webClient.OpenReadAsync(m_uri); 

     }    


    void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) 
    { 
     int count; 

     Stream stream = e.Result; 

     byte[] buffer = new byte[1024]; 

 { 

      // isf.Remove(); 
      //if (!isf.FileExists("map")) 
      //{ 


      using (System.IO.IsolatedStorage.IsolatedStorageFileStream isfs = new IsolatedStorageFileStream("map", FileMode.Create, isf)) 
      { 
       count = 0; 

       while (0 < (count = stream.Read(buffer, 0, buffer.Length))) 
       { 
        isfs.Write(buffer, 0, count); 
       } 

       stream.Close(); 
       isfs.Close(); 
      } 
     } 
関連する問題