C# program with WinRAR

open WINRAR using C# program

Page 1 of 1

4 Replies - 9956 Views - Last Post: 17 September 2009 - 12:47 AM Rate Topic: -----

#1 dunk_6  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

C# program with WinRAR

Posted 14 September 2009 - 02:12 AM

Hi all,

I want to design a c# program which can run WinRAR. the program will browse for file and send the with a button, the process to create archive will begin..!

I know using System.Diagnostics.Process.Start method can execute the exe file. for eg.

Process.Start(@"C:\path\to\file.zip")

GetFile("filename","open winrar to execute the file") I need something like this. How should i start? Any references/solution are very thankful.

thank you very much.

Is This A Good Question/Topic? 0
  • +

Replies To: C# program with WinRAR

#2 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 528
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: C# program with WinRAR

Posted 14 September 2009 - 08:57 AM

I don't use WinRAR, so I cannot fully confirm this site, but try creating the process start directly to the rar tool and making the path to extract part of the arguments.
Here is the command line usage of winrar:
http://www.respower...._tutorial_unrar

If you need actual code to do this, just ask. I think you'll be able to manage this though.

Hopefully this helps.
Was This Post Helpful? 0
  • +
  • -

#3 dunk_6  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

Re: C# program with WinRAR

Posted 16 September 2009 - 06:51 PM

View PostMentalFloss, on 14 Sep, 2009 - 07:57 AM, said:

Here is the command line usage of winrar:
http://www.respower...._tutorial_unrar
Hopefully this helps.


I'm kind of understand but i don't know how to run it. I'm using Vista, do i need to change into WINXP to run it?

Quote

If you need actual code to do this, just ask. I think you'll be able to manage this though.


the actual code? it would great if u can give me.

Thank you very much.
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: C# program with WinRAR

Posted 16 September 2009 - 07:31 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#5 dunk_6  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 43
  • Joined: 03-August 09

Re: C# program with WinRAR

Posted 17 September 2009 - 12:47 AM

Quote

Here is the command line usage of winrar:
http://www.respower...._tutorial_unrar
Hopefully this helps.


This is one part of the program..
This code open all WinRAR program if not error occur. I put this in button, and checking of file is given in txtDest.text using browse folder. So instead of open, i want it to be execute(compress) directly.

ProcessStartInfo startInfo = new ProcessStartInfo("WinRAR.exe");
	startInfo.WindowStyle = ProcessWindowStyle.Maximized;
	startInfo.Arguments = txtDest.Text;
	try
	{
		// Call WaitForExit and then the using statement will close.
		using (Process exeProcess = Process.Start(startInfo))
		{
			exeProcess.WaitForExit();
		}
	}
	catch
	{
		MessageBox.Show("Error Open");
	}


This post has been edited by dunk_6: 17 September 2009 - 01:35 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1