469,286 Members | 2,399 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

windows 2003 server

Hi ,

I am using windows 2003 and .net 1.1
I am trying to download word document.
this code works fine in windows 2000 .
but when i access in windows 2003 server
I get access denied (401)unautorized.

plz help
The following code is below:

Environment.CurrentDirectory = Environment.GetEnvironmentVariable("temp");

DirectoryInfo info = new DirectoryInfo(".");
CrmService service = new CrmService();

service.Credentials = System.Net.CredentialCache.DefaultCredentials;
string attachid =

string objecttypecode = "1070"; //SaleLiteratureItem
System.Net.WebClient myWebClient = new System.Net.WebClient();

myWebClient.Credentials = System.Net.CredentialCache.DefaultCredentials;

string url1 =
"http://dynamics/Activities/Attachment/download.aspx?AttachmentType=" +
objecttypecode + "&AttachmentId=" + attachid;

myWebClient.DownloadFile(url1,info.FullName+"\\Fir st.doc");//(401
Thanks and Regards
Apr 6 '07 #1
0 937

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Nathan Sokalski | last post: by
2 posts views Thread by Joseph Geretz | last post: by
7 posts views Thread by Cliff Harris | last post: by
reply views Thread by Charles Leonard | last post: by
7 posts views Thread by =?Utf-8?B?RWRkaWU=?= | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.