473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to open a file that contains some other extension like(.mxd) when button is click

1 New Member
How to open a file that contains some other extension like(.mxd) when button is click
Dec 12 '10 #1
2 2251
xMetalDetectorx
44 New Member
How about trying FileStream class?
Expand|Select|Wrap|Line Numbers
  1. using System.IO;
  2.  
  3. FileStream fileStream = new FileStream(@"c:\file.txt", FileMode.Open);
  4. try
  5. {
  6.   // read from file or write to file
  7. }
  8. finally
  9. {
  10.   fileStream.Close();
  11. }
  12.  
Dec 14 '10 #2
Scotty Islegit
1 New Member
Expand|Select|Wrap|Line Numbers
  1. private void OpenAsProcess(string path)
  2. {
  3.     if (!string.IsNullOrEmpty(path))
  4.     {
  5.         try
  6.         {
  7.             Process.Start(new ProcessStartInfo(path));
  8.         }
  9.         catch (Exception e)
  10.         {
  11.             Console.WriteLine(e.Message);
  12.         }
  13.     }
  14. }
  15.  
Dec 15 '10 #3

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

Similar topics

2
by: Bruce B | last post by:
(Access 2000) I have: Set eWB = e.Workbooks.Open("Book1.xls") Where e is DIM'd as an Excel.Application and eWB as an Excel.Workbook. This file opens fine.
1
by: sukanya s via .NET 247 | last post by:
(Type your message here) -------------------------------- From: sukanya s i am doing a project in asp.net (web application).Can anyone please tell me how to run a batch file within a button...
1
by: Seok Bee | last post by:
Dear Experts, I'm trying to open a file from my web form. However, when I click on the button, no action is being performed. I have tried running it in debugging mode, the file is able to open....
1
by: iceburn17 | last post by:
Hi, Can anyone can tell me how to change a table row background color when I click a button? most of the tutorial I found add the event on the TR onclick event, but that not I want. It is...
3
seshu
by: seshu | last post by:
hi everybody the problem i have is i have created a doc file on form load and this is even get created well but i wrote a code to copy the file from that location to someothere location wheen i run...
8
by: Deft.Jab | last post by:
This problem only exists in IE, due to UI restrictions I'm using a href in an error label to bring up a modal popup. I'm using a callback to filter a grid on the popup. The problem: The href...
2
by: jayasabari | last post by:
Hai, When button is clicked, then i have to prevent the execution of one function in page load. can you give any suggestion please. With Regards, K.Jayasabari
9
by: ghjk | last post by:
change the background image when Button Click ====================================== I' developing site with php and postgres. It has menus list in the left side. and all are images(jpg) EX:Add...
10
by: thayes5150 | last post by:
I have an access database that uses a subform to display records, one column of which is charge data (currency). My users need to verify the charges against the paper form they are scanned from, so...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.