kleptos Posted August 11, 2003 Posted August 11, 2003 I am working on a keygen (dont get the wrong idea, its for an encryption algorithm example from Microsoft, not a tool for illegally stealing software) and i am building it using the .NET Framework, and not VS.NET or any IDE. Below is the code to compile the application on the command line. When i compile, everything runs great. However when i run the exe i get an error(see below). If i got my code right, it should use the embeded resource App.ico as the icon for the form, or so i thought, but i get this error. Any help would be appreciated. csc /t:winexe /out:Keygen.exe /res:App.ico /r:Crypto.dll /win32icon:App.ico Keygen.cs AssemblyInfo.cs this.Icon = new Icon(GetType(),"App.ico"); http://www.animatedtoys.com/misc/keygen_error.gif Quote ..::[ kleptos ]::..
Leaders dynamic_sysop Posted August 11, 2003 Leaders Posted August 11, 2003 assuming you have got the Icon embeded , try this... this.Icon=new Icon(this.GetType().Assembly.GetManifestResourceStream("over_rides_c.Icon1.ico")); /// replacing over_rides_c with your app's name. Quote
kleptos Posted August 11, 2003 Author Posted August 11, 2003 I get the same error. Am i compiling the icon correctly? Quote ..::[ kleptos ]::..
kleptos Posted August 11, 2003 Author Posted August 11, 2003 Actually, that did work, i just had to modify it a little. I didnt include the application name, just the file name. this.Icon=new Icon(this.GetType().Assembly.GetManifestResourceStream(".Icon1.ico")); Quote ..::[ kleptos ]::..
Hamburger1984 Posted August 11, 2003 Posted August 11, 2003 I think you should first create a *.resources-File from the Icon with the tool named "Resgen.exe"... resgen App.ico App.ico.resources the next step would be compiling... csc /t:winexe /out:Keygen.exe /res:App.ico.resources /r:Crypto.dll /win32icon:App.ico Keygen.cs AssemblyInfo.cs hope this helps! Andreas Quote
kleptos Posted August 13, 2003 Author Posted August 13, 2003 The resource idea worked too. Took me a little while longer to get it to work, but i got it. Thanks for all the help. Quote ..::[ kleptos ]::..
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.