Click here to Skip to main content
15,895,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Try Download Specified Exe File From Internet And Store It With this code

C#
byte[] down = Web.DownloadData("Address");

System.IO.File.WriteAllBytes("myfile.exe", down);


But When I Want To Execute File This Error Occurred :

The NTVDM CPU Has Encountered An Illegal Instruction

But When I Download This File Normally with (idm) Execute

What Is Problem ?

This My Address And This Executed File:

"http://www.persiangig.com/pages/download/?dl=http://patymaty.persiangig.com/document/ConsoleApplication1.exe"

Thanks
Posted
Updated 20-Oct-11 20:09pm
v2

1 solution

A parameter should be System.Uri or string. If this is a string, it should get URI format, not just "Address"; it should be something like "http://www.domain.tld/myDirectory/myFile.exe".

Besides, how do you know that executable file is good in first place, compiled for your platform, etc.?

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900