0

기본적으로 여기에 시나리오가 있습니다. 모바일에 최적화 된 ASP.NET (3.5 프레임 워크) 응용 프로그램을 만들었고 comapct 프레임 워크 5.0 운영 체제에서 실행되는 Motorola GUN에 xml 파일을 다운로드 할 수있는 링크를 추가했습니다.Compact Framework에서 XML 파일 다운로드

파일 다운로드 로직은 데스크톱/랩톱에서 작동하지만 Windows CE 디바이스에서는 잘 작동합니다. 파일을 다운로드하는 대신 IE 브라우저에서 XML 파일을 여는 중입니다.

나는 experties가 여기에 도움이 :) 장치는 위해 설계되어 파일을 처리하는 것입니다

답변

0

해야합니다.

파일을 옥텟 스트림으로 보내보십시오. 여기

내가 다시 잠시 않았다 비슷한이지만, 모바일 장치에서 작동하는 경우에 나는 확실하지 않다 다음 help.Actually에 대한 jp2code- 감사합니다 @

if (!String.IsNullOrEmpty(nameOnly)) { 
     string filename = Server.MapPath(nameOnly); 
     if (!String.IsNullOrEmpty(filename)) { 
     try { 
      Response.Buffer = false; 
      Response.Clear(); // clear the buffer 
      Response.Cache.SetCacheability(HttpCacheability.NoCache); 
      if (-1 < filename.IndexOf(".avi")) { 
      Response.ContentType = "video/x-msvideo"; 
      } else if (-1 < filename.IndexOf(".pdf")) { 
      Response.ContentType = "Application/pdf"; 
      } else if (-1 < filename.IndexOf(".rar")) { 
      Response.ContentType = "Application/x-rar-compressed"; 
      } else { 
      Response.ContentType = "Application/octet-stream"; 
      } 
      FileInfo file = new FileInfo(filename); 
      Response.AddHeader("Content-Disposition", "attachment; filename=" + nameOnly); 
      Response.AddHeader("Content-Length", file.Length.ToString()); 
      Response.WriteFile(file.FullName); 
     } catch (Exception err) { 
      outputLine = err.Message; 
     } finally { 
      Response.Flush(); 
     } 
     } else { 
     outputLine = string.Format("Server was unable to locate file \"{0}\".", nameOnly); 
     } 
    } 
+0

,이 방법하지만 결과 시도 바탕 화면에서는 잘 작동하지만 Windows CE에서는 제대로 작동하지 않습니다. –