Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi every body !
I'm trying to extract an embedded resources file in a codeDOM project
Let me explain more:
I use CodeDOM to compile applications where they contains files embedded in they resources ...
I want, when I open the program (generated by CodeDOM compiler) the resources embedded get extracted to the desktop for e.g!

I have the same code but compiled in C# ... I try to convert this code using some converters but i can't !!

This is the part of the code that i'm trying to convert:

C#
private void Form1_Load(object sender, EventArgs e)
		{
			Visible = false;
			ShowInTaskbar = false;

			FolderBrowserDialog fbd = new FolderBrowserDialog();
			fbd.Description = "Please, select a destination folder.";

			if (fbd.ShowDialog() == DialogResult.OK)
			{
				Assembly ass = Assembly.GetExecutingAssembly();
				string[] res = ass.GetManifestResourceNames();

				try
				{
					foreach (string name in res)
					{
						Stream rs = ass.GetManifestResourceStream(name);

						using (Stream gzip = new GZipStream(rs, CompressionMode.Decompress, true))
						{
							string path = Path.Combine(fbd.SelectedPath, Path.GetFileNameWithoutExtension(name)); 
							
							using (Stream file = File.Create(path))
							{
								for (int b = gzip.ReadByte(); b != -1; b = gzip.ReadByte())
								{
									file.WriteByte((byte)b);
								}
							}
						}
					}




And this is the whole project link:

Self-Extractor[^]

Thanks.
Posted
Comments
kbrandwijk 7-Sep-14 15:00pm    
Have you tried to convert it yourself? What is the problem you run into trying to convert it? What have you already tried yourself?
3a©roub 7-Sep-14 18:25pm    
I tried to convert it by my self but at this line i can't !!

<pre lang="c#">for (int b = gzip.ReadByte(); b != -1; b = gzip.ReadByte())
{
file.WriteByte((byte)b);
}</pre>

Any help ... !

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