2012-05-31 4 views
1

안녕하세요 IsolatedStorageFile이 있는데 이미지 파일이므로이 이미지를 서버 측에 업로드하여 Avatar를 사용하여 이미지의 바이트 []를 업로드 할 수 있습니다.이미지를 업로드하는 방법 wp7 serverside.?

내 코드는 다음과 같습니다.

using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) 
      { 
       // Open the file - error handling omitted for brevity 
       // Note: If the image does not exist in isolated storage the following exception will be generated: 
       // System.IO.IsolatedStorage.IsolatedStorageException was unhandled 
       // Message=Operation not permitted on IsolatedStorageFileStream 
       using (IsolatedStorageFileStream isfs = isf.OpenFile("myImage.jpg", FileMode.Open, FileAccess.Read)) 
       { 
        // Allocate an array large enough for the entire file 
        data = new byte[isfs.Length]; 
        // Read the entire file and then close it 
        isfs.Read(data, 0, data.Length); 
        isfs.Close(); 
       } 
      } 

      // Create memory stream and bitmap 
      MemoryStream ms = new MemoryStream(data); 
      BitmapImage bi = new BitmapImage(); 
      // Set bitmap source to memory stream 
      bi.SetSource(ms); 

어떻게이 바이트 []를 webClient 또는 HttpwebRequest에 업로드 할 수 있습니까?

감사합니다.

답변

0

File Upload 링크를 확인해 보셨습니까? 이것은 효과가있다.

관련 문제