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 it's a folder it must open the Folder
No problem there, but when I want to open a file without extension, that
hasn't offcourse a default application, I'm getting an error. I'd prefer to
have the "Choose Program"-dialog.
Any idea how I should open the files to have this?
Thanks a lot in advance,
Pieter
I'm using this now:
Dim prcLogin As New Process
Try
prcLogin.StartInfo.UseShellExecute = True
prcLogin.StartInfo.RedirectStandardOutput = False
prcLogin.StartInfo.FileName = strName
If strArg <> "" Then
prcLogin.StartInfo.Arguments = strArg
End If
prcLogin.Start()
Catch ex As Exception
MessageBox.Show("Can't open the file!", MessageBoxButtons.OK,
MessageBoxIcon.Error) '-> happens when the file doesn't have an
extension....
End Try
prcLogin.Close()
Simon - 18 Nov 2005 16:37 GMT
Try using:
System.Diagnostics.Process.Start(FileName)
> Hi,
>
[quoted text clipped - 31 lines]
> End Try
> prcLogin.Close()
td - 19 Jan 2006 23:25 GMT
This works for me!
Thanks Simon
Terry
> Try using:
> System.Diagnostics.Process.Start(FileName)
[quoted text clipped - 34 lines]
> > End Try
> > prcLogin.Close()
Herfried K. Wagner [MVP] - 18 Nov 2005 23:36 GMT
"Pieter" <pietercoucke@hotmail.com> schrieb:
> From my VB.NET 2005 application I need to be able to open Files an
> Directory's with their default application:
[quoted text clipped - 5 lines]
> hasn't offcourse a default application, I'm getting an error. I'd prefer
> to have the "Choose Program"-dialog.
Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en>
+
Displaying the "Open with..." dialog
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openwithdialog&lang=en>

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Pieter - 21 Nov 2005 08:57 GMT
Thanks Herfried! That was exactly waht I was looking for!
> "Pieter" <pietercoucke@hotmail.com> schrieb:
>> From my VB.NET 2005 application I need to be able to open Files an
[quoted text clipped - 14 lines]
> Displaying the "Open with..." dialog
> <URL:http://dotnet.mvps.org/dotnet/faqs/?id=openwithdialog&lang=en>