我有2个.net文件!一次使用c#.net,另一次使用vb.net :)
现在我想读取它的字节并运行它:)
Dim mybyte As Byte() = System.IO.File.ReadAllBytes("E:\Projects\Expired.exe")
System.Reflection.Assembly.load(mybyte)
无法加载从mybyte加载的文件或程序集'8192字节
您必须读取文件,进行填充(解密?),然后将内容写入新文件并运行。这样的事情(如果需要,您可以将文件嵌入项目资源中):
// Read file content from project resources
byte[] fileContent = MyProject.Properties.Resources.MyFile;
// <Do your stuffs with file content here>
// Write new file content to a temp file
string tempFile = "yourfile.exe";
File.WriteAllBytes(tempFile , fileContent );
// Run the app
Process proc = Process.Start(new ProcessStartInfo(tempFile));
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句