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

files opened by process

Hi
I want to know about all files opened by some process. I found shell function NtQuerySystemInformation. I'm looking for similar function in .net.
Dec 14 '07 #1
1 935
demaus
6
In .Net you can use Process.Start("c:\filename.ext") and this will start files that have an associated filetype. I have seen where this will also bring up the dialog box to associate the filetype, but recently I have run into the problem that Windows did NOT. So I needed to catch the exception.

Incidently I am using VS2005, VB.NET

Expand|Select|Wrap|Line Numbers
  1.  
  2. Try
  3.  
  4. Process.Start("c:\filename.ext")
  5. Catch exp As System.ComponentModel.Win32Exception
  6. If exp.Message.Substring(0, 10).ToUpper = "NO APPLICA" Then
  7. MessageBox.Show("The document that you were trying to open has encountered an error. The extension of this file type has not been associated with a program.","Opening Attachment", MessageBoxButtons.OK, MessageBoxIcon.Error)
  8. End If
  9. End Try
  10.  
Dec 14 '07 #2

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

Similar topics

1
by: Top Hat | last post by:
Greetings! My application uses several files that contain constants, error code, etc that are located in a directory call /bin. At times when I am testing the application in "debug" mode, the...
1
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
3
by: Cameron | last post by:
How can you tell if a file is locked/being written to by another process? -Cam
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
1
by: KnUser | last post by:
Is there a way to get to know if a file is opened by a process?
2
by: DoB | last post by:
Hi, I would like to get the list of full paths of all files that are currently opened by any process in the system. Is this possible? In short: my program moves a bunch of directories and I...
2
by: hharry | last post by:
Hello All, Does anyone know of a method to automatically detect if a file is corrupted ? Due to a failed backup process a number of files were corrupted. The files are mostly .xls, .doc, .pdf....
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
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
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
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...
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
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,...

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.