C# class similar to Java Desktop class [duplicate] - c#

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open file with associated application
I want to open a file in it respective application, e.g. open function of windows.
Same thing can be done in java with the help of Desktop class where you pass the file name and the respective file is opened.
But no idea how to do in C#.

System.Diagnostics.Process.Start("filename.doc");

Related

How can I establish my windows form application (c#) as the principle application to open a file extension? [duplicate]

This question already has answers here:
Windows file associations done properly?
(1 answer)
How to associate a file extension to the current executable in C#
(9 answers)
Closed 6 years ago.
I have a windows form application made in c#, and I want to set a file extension (.txt for example) to open automactily with my application and my icon instead of the NotePad. How can I do it?

How to make file to be opened by my app? [duplicate]

This question already has answers here:
Where does Windows store its "Open With" settings?
(3 answers)
Closed 9 years ago.
I have a little bit confusing problem. I'm not a beginner but I don't know how to do it..
For example I've written a program like notepad from which you can open files, save and etc. But when I set any custom format like ".blabla" to be opened by my app it is not working, so how can I make it to be opened by my app?
It is in WinForms
You need an entry in the registry for custom file extensions. You can try inserting a key in the registry as follows:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

C# launch power options [duplicate]

This question already has answers here:
How can run functions of powercfg by C# code?
(3 answers)
Closed 9 years ago.
From my C# program I want to open the power options from the control panel in Windows.
However I can't seem to find out how to do that, I tried making a shortcut and see where it goes but it is referring to the control panel.
Does anyone have an idea how to do that or where the exe is located to launch?
Try the following:
System.Diagnostics.Process.Start("powercfg.cpl");

Running execute file in c# [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to shell execute a file in C#?
How can i run an execute file in c# (by command line)?
and in addition, I want to save the output and see it on the screen?
See the System.Diagnostics.Process class. See MSDN.
You use the StadardOutput (and optionally StandardError) to get the output and put it at the screen any way you want.

How to view which files is Writing a Process [duplicate]

This question already has answers here:
How do I get the list of open file handles by process in C#?
(7 answers)
Closed 7 years ago.
Is there a way to get List of Files or FileName which a Process is writing (if possible writing/reading/appending) ,from C# ,which means im talking about Windows (NT,Vista,XP,7).
see here: How do I get the list of open file handles by process in C#?

Categories