Hi All,
I want to write C# code to identify a file type and open the file in
the associated editor.
For example, text files should be identified and opened in notepad,
html should be opened in internet explorer/netscape/mozilla.
At design time, I do not know if internet explorer/netscape is
installed on the client machine. The C# code should identify that and
open.
Please help.
Regards,
Shilpa 3 3595
Shilpa wrote: Hi All,
I want to write C# code to identify a file type and open the file in the associated editor. For example, text files should be identified and opened in notepad, html should be opened in internet explorer/netscape/mozilla. At design time, I do not know if internet explorer/netscape is installed on the client machine. The C# code should identify that and open.
What you want to do is not necessary. Simply set the file name to the
Command property of the ProcessInfo class and then execute
ProcessInfo.Sta rt. The class will figure out the appropriate editor to
start. However, if the file has no association, you'll get a
Win32Exception which you should catch and decide what to do next.
Regards Please help.
Regards, Shilpa
Hey Frank,
Thanks a lot.
Could you please send a code sample.
Regards,
Shilpa
Shilpa wrote: Hey Frank,
Thanks a lot. Could you please send a code sample.
Regards, Shilpa
System.Diagnost ics.Process prc = new
System.Diagnost ics.Process();
try
{
prc.StartInfo.F ileName = "myfile.doc ";
prc.Start();
}
catch (System.Compone ntModel.Win32Ex ception ex)
{
}
catch (Exception ex)
{
} This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: clintonG |
last post by:
I can't tell you how frustrated I get when going to a web developer's
website and observing he or she is an idiot that has not grasped
the most fundamental element of usability: page title naming conventions.
1.) You know you are at an idiot's website when there is no page title.
Listen up idiot. Give every page a name using the HTML <title> element.
2.) When naming your page do not put the name of your website or your
company 'after'...
|
by: Eric |
last post by:
Hi,
I need to find a way to identify between a few different file formats
WITHOUT looking at the file extension. Very often our customers will name
file incorrectly. For example, they'll send us a file that's named
'filename.xls', but it's actually a tab delimited or comma delimited file.
The possible formats that I need to identify are: HTML, tab delimited, comma
delimited or Excel.
|
by: Goh |
last post by:
Hi,
I would like to know how can we implement a web page that
intelligent enough to unique identify that pc have been visit before without
any cookies and login user require.
I have try implement this by MAC address. When user browser the web
site I sometime can get user pc MAC and sometime no.
Why this type of implementation are so not consistency? Does any
|
by: Michel |
last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for
the user; the user open my app, do some works and try to open another
instance of my app, I whant to show a message to user to inform him that only
one instance is permit and then close the second instance after that.
I am able to do this when the user run the application on his PC whit this :
Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName)
...
|
by: Shilpa |
last post by:
Hi All,
I want to write C# code to identify a file type and open the file in
the associated editor.
For example, text files should be identified and opened in notepad,
html should be opened in internet explorer/netscape/mozilla.
At design time, I do not know if internet explorer/netscape is
installed on the client machine. The C# code should identify that and
open.
| |
by: Daniel Mark |
last post by:
Hello all:
I have following code that works well under command line, but it
doesn't work after I convert it
as exe application.
############### file: testPath.py
import getopt, math, sys, os, Image, ImageDraw, aggdraw
def processline():
|
by: h112211 |
last post by:
Hi,
I installed the newest available PIL (1.1.5 for Python 2.4) from their
site, but cannot seem to open any files. The following
from PIL import Image
i = Image.open(file('c:\\image2.png'))
results in
|
by: Pieter |
last post by:
Hi,
For some procedures that throws exceptions, I would like to show different
messages to the user depending on what type of exception he's getting. For
instance this one: when the file is locked, I want a messagebox to tell that
the user has to close the file first.
Is there a way to identify an exception by some kind of unique number or
something like this? I don't want to identify it on the Exception Message
because some users are...
|
by: Mobileboy36 |
last post by:
I'm searching a way to identify jpg files from a digital cam
Let's say we have 2 digital cameras C1 and C2 and 2 files JPG001.jpg from C1
and JPG001.jpg from C2. Is there a way to distinct the 2 files from each
other, reading a certain position in the stream of bytes? Or better, does
anyone have a example piece of vb.net code?
best regards,
|
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...
|
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,...
| |
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...
|
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |