简体   繁体   中英

How to convert this download code to CodeDOM?

I'm new to using codedom.

Can someone tell me how to convert this code to be run in C#?

Code:

WebClient webClient = new WebClient();
webClient.DownloadFile("http://mysite.com/myfile.txt", @"c:\myfile.txt");

A fully working CodeDom code sample is here:

http://msdn.microsoft.com/en-us/library/system.codedom.compiler.codedomprovider.aspx

Copy the code for CodeDomExample into a new class file (*.cs) and modify the CodeTypeReferenceExpression and the subsequent CodeMethodInvokeExpression instances to what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM