Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

..::[ kleptos ]::..
  • Leaders
Posted

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.

Posted

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"));

..::[ kleptos ]::..
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...