2009-05-04 3 views
0

.NET 3.5에서 WebClient 클래스를 사용하여 파일을 다운로드 중입니다. 나는 서버 측에서 요청 된 파일이 IE 클라이언트와 함께 다운로드 된 것으로 보입니다. 정확히 무엇을 바꾸어야합니까?WebClient 클래스가있는 IE 클라이언트의 요청을 시뮬레이트 하시겠습니까?

IE에서 생성 한 헤더 정보를 WebClient 개체의 Header 속성에 복사하기 만하면됩니까? 내가해야 할 일이 더 있니?

감사합니다.

답변

0

짧은 대답은 yes입니다.

다음 코드는 전체 헤더 정보를 제공합니다. 원하는대로 브라우저에서 실행하면 수행해야하는 설정이됩니다.

<html> 
<body> 

<script type="text/javascript"> 
var x = navigator; 
document.write("CodeName=" + x.appCodeName); 
document.write("<br />"); 
document.write("MinorVersion=" + x.appMinorVersion); 
document.write("<br />"); 
document.write("Name=" + x.appName); 
document.write("<br />"); 
document.write("Version=" + x.appVersion); 
document.write("<br />"); 
document.write("CookieEnabled=" + x.cookieEnabled); 
document.write("<br />"); 
document.write("CPUClass=" + x.cpuClass); 
document.write("<br />"); 
document.write("OnLine=" + x.onLine); 
document.write("<br />"); 
document.write("Platform=" + x.platform); 
document.write("<br />"); 
document.write("UA=" + x.userAgent); 
document.write("<br />"); 
document.write("BrowserLanguage=" + x.browserLanguage); 
document.write("<br />"); 
document.write("SystemLanguage=" + x.systemLanguage); 
document.write("<br />"); 
document.write("UserLanguage=" + x.userLanguage); 
</script> 

</body> 
</html> 
관련 문제