473,785 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open file base on type

I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.Output Stream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!
Aug 3 '08 #1
2 1395
On Aug 3, 11:46 am, AY Xu <ay...@yahoo.co mwrote:
I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.

In asp.net, I use Response.Output Stream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!
If i understood correclty,

System.Diagnost ics.Process.Sta rt
http://msdn.microsoft.com/en-us/libr...ess.start.aspx

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur Güzel
Aug 3 '08 #2
On 8ÔÂ3ÈÕ, ÏÂÎç5ʱ19·Ö, kimiraikkonen <kimiraikkone.. ..@gmail.comwro te:
On Aug 3, 11:46 am, AY Xu <ay...@yahoo.co mwrote:
I have a data grid view, list the files saved in SQL server. File type
may different in different rows. I want to achieve:
doule click one row in data grid view, a standard program be called to
open the selected file. Say MS word to open a .doc file, MS power
point to open .ppt file, etc.
In asp.net, I use Response.Output Stream.Write to achieve this, it's
pretty easy. is that a similar way in Windows application? Thanks in
advance!

If i understood correclty,

System.Diagnost ics.Process.Sta rthttp://msdn.microsoft. com/en-us/library/system.diagnost ics.process.st. ..

Sure, if necessary applications have been associated with proper file
types like Ms Word for *.doc extensions already.

Hope this helps,

Onur G¨¹zel
Great, you point me to the right direction! i just set the file name,
then process.start() , .net automatically start right program to open
the file. that's great! thanks for help!
Aug 3 '08 #3

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

Similar topics

1
462
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs to see, i.e. for documents of type A, I use form A, for type B, form B, etc. Each document has a unique number. I need the app to only show one document at a time, i.e. ifthe user tries to open doc. 1 of type A, then open form A and load doc 1....
29
2285
by: Bill Marsden | last post by:
Hi. I am an under-graduate currently studying Open Source (Linux) vs Closed Source and Collaboration within the IT Community. I am fairly new to Javascript and I have written a "Lottery Program" which essentially picks 6 numbers at random and puts them in sequence. Would anyone would be interested in modifying the code below to a). Check for bugs b). Make the program more efficient
0
2979
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they entered. When this button is pressed and extract is prduced and IE's standard Open/Save dialog should popup so they can navigate to the directory to save the extract in, or if they want, they can choose to open and view the extract without saving it. ...
3
1663
by: ccole | last post by:
I have about thirteen configuration files that are written in XML. I need to be able to read and cross reference these files with each other. I have already written an xsl translator but due to the large size of the file it is very slow. I have also been unable to access some of the relationships contained in the document when using xsl. What would be the easiest way to do this using visual C#? Below is a brief sample from one of the...
1
1815
by: S | last post by:
Hi, I have the following xml file <?xml version="1.0" encoding="UTF-8" ?> <n1:Message xmlns:n1="nz:govt:moh:schemas:diabetes-cardio.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <MessageHeader> <Site>pho1diab</Site> <SendingApplication>MyPracticePMS 8.05a</SendingApplication> <SendingFacility>PracticeName or HeathLinkMailBox</SendingFacility>
13
3560
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but none of the server-side code is rendered. If I view the source of the page, the code (and page...
4
12420
by: Jon Davis | last post by:
Newbie to WCF here. I am getting the error "unable to open its IChannelListener", but the service is running as an admin, and on a different port from anything else. If it matters, I'm trying to run multiple instances of the same service name on different schemes/ports, so that WAN users can use HTTP/SOAP, LAN users can use TCP, and localhost users can use named pipes. Apparently, this isn't doable. I suspect a service name conflict?...
0
2632
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of the particle of the base this xsd file is valid as per w3c standard i am also providing error in detail and geometry.xsd file geometry.xsd <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://www.opengis.net/gml"...
4
11957
by: JaxDawg | last post by:
I have a spreadsheet saved as an XML spreadsheet so I can manipulate it easier (and don't need COM). When I'm done, I want to display to the user. Currently, I'm using simple JavaScript in my PHP file to display the file when complete: echo '<script type="text/javascript"window.open("'.$file_nm.'")</ script>'; Since the file is .XML, which defaults to the browser to open - the above code will display the XML as raw XML (text) in a new...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.