TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Daniel Lipman
1.4k
374
14k
How can i use a Process to open a directory for browsing ?
Aug 4 2013 11:49 AM
Hi,
What i want to do is two things:
1. Button click in an event will use a Process to open a directory so i can see the directory like explorer.
2. When i close the window of the directory/process an event Exited of the Process will rise.
What i did so far is in Form1 top added:
private Process zipFileDirectoryProcess;
Then in the constructor i did:
zipFileDirectoryProcess = new Process();
zipFileDirectoryProcess.StartInfo.FileName = "explorer.exe";
zipFileDirectoryProcess.StartInfo.CreateNoWindow = true;
zipFileDirectoryProcess.EnableRaisingEvents = true;
zipFileDirectoryProcess.Exited += new EventHandler(zipFileDirectoryProcess_Exited);
Then in i have a method i call it from a button click event inside the method i did:
zipFileDirectoryProcess.StartInfo.WorkingDirectory = t;
zipFileDirectoryProcess.Start();//= Process.Start(Path.GetFullPath(t));
this.TopMost = true;
What i want is that the process will open/show the directory variable: t
If i was doing: zipFileDirectoryProcess = Process.Start(Path.GetFullPath(t)); then it will open the directory but then the event Exited never fire.
Then in the bottom of Form1 i have:
private void zipFileDirectoryProcess_Exited(object sender, EventArgs e)
{
this.TopMost = false;
}
So how can i do that the process also open the directory variable: t and also will raise the event zipFileDirectoryProcess_Exited ?
Reply
Answers (
1
)
Collections query ??
Weather webservice ASP.NET c#