473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to Open a File in the Default Application

Hi!

Im having trouble with Process.Start(); Let me show you.


Process p = Process.Start(file);

MessageBox.Show(p.Id.ToString());


"file" is the path to the file I want to open and not a program. The problem Im having is that "p" is null even after the file was successfully opened in default program. This means I cant get the PID for the application I just started.

Any ideas?

regards

It actually worked all the time. The wiered thing is that it doesnt work with windows media player. Whit others like notepad and winrar it works. But for WMP it dosnt even thou its not running and so on.

Why this?
Oct 9 '10 #1
0 835

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Doug Wyatt | last post by:
So I have a log file that I'm writing with one C# program and want to open and read it in another one. I open it via : StreamWriter log = File.AppendText(logPath); log.AutoFlush = true; but...
5
by: Mr Gordonz | last post by:
Hi all, I want to put a button on a page, and when the user clicks it, the standard Windows "Open File" dialogue box opens, and the user can browse/select a file on their PC. Having selected a...
3
by: grzybek | last post by:
Hi, I upload files to ma Web Server and then I can view those files as link. I'd like to be able to open those file in proper application on client PC. I want achieve the same result as though...
2
by: nissiml | last post by:
hi, i'm trying to open a asp.net web page that list files from a Windows application like winword and select a file from it . what do i have to do to make it happen, is it simple ? Thanks in...
4
by: Pieter | last post by:
Hi, From my VB.NET 2005 application I need to be able to open Files an Directory's with their default application: - A word-doc must open in word - A excell-document in Excel etc - in case...
6
by: tactics40 | last post by:
I'm writing a GUI application in Jython which takes a database text file and performs some operations on the data, finally spitting out a group of CSV files. I generate a log file and several...
5
by: Ryan Liu | last post by:
Hi, Both way works, I'd just ask some experts which way is better? My application creates a log file daily. Now each time when I write a log, I will open the file and append to the end....
4
by: nuhura01 | last post by:
Hi, I want to create an 'open file button' which will display open file dialog box for users to choose the location of folders to be read. It might be easy for Windows Application, but i want to...
4
by: nuhura01 | last post by:
Hi, I want to create an 'open file button' using asp control button, which will display open file dialog box for users to choose the location of folders to be read. It might be easy for Windows...
5
by: =?Utf-8?B?Um9i?= | last post by:
Hi all, I want to fire the drag events when someone drags a file over the application's icon. This means the application has not opened yet. Scenario would be: 1. user selects file they want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.