473,398 Members | 2,335 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,398 software developers and data experts.

Opening a file... any file (cross-posted microsoft.public.dotnet.languages.vb;microsoft.pub lic.dotnet.framework.windowsforms.controls)

Hello

I am trying to set up an open file routine that will open whatever files
name is passed with its correct associated application. I have done this
(quite easilly) before in VBA and am able to open pretty much anything I
want using shell execute etc.

I tried importing the old code into VB dotNet and it executes fine but just
doesn't actually open the file. No errors returned at all (?).

I also tried using an openFileDialog and can get the filename etc. but can't
figure out how to actually open the file :@(

Anyone got any sample code or suggestions? This is hurting my head big time.
Should be so simple...

TIA

Mark
Nov 21 '05 #1
9 1705
Sorry folks... Found it on Google minutes after my last post.

Used

System.Diagnostics.Process.Start("filePath.etc")

and it works just fine :@)
Nov 21 '05 #2

Look up the System.Diagnostics.Process object...

"Mark" <ma**@tencdf.com> wrote in message
news:Iv*****************@newsfe5-gui.ntli.net...
Hello

I am trying to set up an open file routine that will open whatever files
name is passed with its correct associated application. I have done this
(quite easilly) before in VBA and am able to open pretty much anything I
want using shell execute etc.

I tried importing the old code into VB dotNet and it executes fine but
just doesn't actually open the file. No errors returned at all (?).

I also tried using an openFileDialog and can get the filename etc. but
can't figure out how to actually open the file :@(

Anyone got any sample code or suggestions? This is hurting my head big
time. Should be so simple...

TIA

Mark

Nov 21 '05 #3
Thanks Robin...

Just found it :@)

Mark
Nov 21 '05 #4
Mark,

The OpenFileDialog will only help you get the Filename. You have to write
the code yourself to open the file. There are many ways in which you can
accomplish File I/O in VB.NET. Here is a link which might help you.

http://msdn.microsoft.com/library/de...albasicnet.asp
Nov 21 '05 #5
Mark,

I thought I would find this thousand times and could copy it, however this
is copied from a German entwickler newsgroup.

\\\
using System.Diagnostics;
..
..
Process.Start(@"C:\foo\bar.doc*");
///

I hope this helps,

Cor
Nov 21 '05 #6
Thanks very much Sarika :@)

Mark
http://msdn.microsoft.com/library/de...albasicnet.asp

Nov 21 '05 #7
Thanks Cor... got it :@)

Mark
Nov 21 '05 #8
"Mark" <ma**@tencdf.com> schrieb:
I am trying to set up an open file routine that will open whatever files
name is passed with its correct associated application. I have done this
(quite easilly) before in VBA and am able to open pretty much anything I
want using shell execute etc.


Opening files, applications, Web documents, and the mail client
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=openfileappwebpage&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #9
Thanks Herfried

Mark
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Helge Jensen | last post by:
Having posted in microsoft.public.dotnet.framework.sdk and microsoft.public.dotnet.framework.wmi without receiving any response, I posthere on the off-chance that someone who isn't following those...
0
by: Frnak McKenney | last post by:
I just spent four hours trying to find out why the checkboxes representing a bound DataGrid DataGridBoolColumn weren't acting properly. When the Form containing the DataGrid was initialized the...
4
by: Vishal | last post by:
Hello, I have a dataset with some content. I can convert this dataset in a csv format which is then stored in a stringwriter. Now I want this be open via excel, so I set the contenttype...
1
by: Jason | last post by:
I have a document saved to a public network server. The public directory grants change access to all users on the network. To keep my Word doc protected I am using the Security feature "File...
18
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that...
6
by: dthompson | last post by:
I have written a service designed to run on 2003 Servers, in development it works 100% on my Windows XP system. Once deployed to 2003 I keep getting the same error (File Not Found, error 53)...
5
by: =?Utf-8?B?U3BlZWR5?= | last post by:
Sorry for aksing such a basic question but I have searched the internet high and low and none of the solutions seem to help. Here is my (not working) code: FileStream fs = new...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.