473,498 Members | 37 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDROM path

I am calling an ASP .NET page through the Web, save it locally and then burn it on a CD. How can I determine the path of the CDROM in which the page resides since each user may have a different drive letter?

Thanks
Nov 18 '05 #1
2 1310
include System.Management;

use this code

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From
Win32_LogicalDisk");
ManagementObjectCollection col = query.Get();
foreach(ManagementObject mo in col)
{
if(int.Parse(mo["DriveType"].ToString()) == 5) // 5 is for CD Rom.
Console.WriteLine("CD Drive " + mo["Name"].ToString());
}

Av.
"Aristeidis Bampakos" <Ar****************@discussions.microsoft.com> wrote
in message news:1E**********************************@microsof t.com...
I am calling an ASP .NET page through the Web, save it locally and then
burn it on a CD. How can I determine the path of the CDROM in which the
page resides since each user may have a different drive letter?

Thanks

Nov 18 '05 #2
The easiest way is to do a MapPath(Request.ApplicationPath) and then
extract the drive letter/path from the resulting physical path. The
Management method gives you the CD-ROM(s), but doesn't tell you which
one your application is in.
/Hugo

avnrao wrote:
include System.Management;

use this code

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From
Win32_LogicalDisk");
ManagementObjectCollection col = query.Get();
foreach(ManagementObject mo in col)
{
if(int.Parse(mo["DriveType"].ToString()) == 5) // 5 is for CD Rom.
Console.WriteLine("CD Drive " + mo["Name"].ToString());
}

Av.
"Aristeidis Bampakos" <Ar****************@discussions.microsoft.com> wrote
in message news:1E**********************************@microsof t.com...
I am calling an ASP .NET page through the Web, save it locally and then
burn it on a CD. How can I determine the path of the CDROM in which the
page resides since each user may have a different drive letter?

Thanks


Nov 18 '05 #3

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

Similar topics

2
1487
by: Silvio Golubović | last post by:
I have a problem with my CDROM. It reads only original cd.
2
2745
by: enclume42 | last post by:
Hello, I am a pure Linux guy. I wrote a Java program that is going to be used by some Windows people, and I wish the startup of the program to be as simple as possible, namely to double-click on...
3
2584
by: M | last post by:
I searched the FAQ for this NG and found no answers to my question... I'm writing an application in Java (I'm not a C programmer), however I need to be able to detect WHICH drive (d:\, e:\...
9
37162
by: Paul Steele | last post by:
I am writing a C# app that needs to periodically poll for cdroms and usb storage device insertions. I've looked at the WMI functions but haven't found anything all that useful. The closest is...
2
1576
by: Jigar Mehta | last post by:
Hye, Does anybody of you have any program or tool ready that can be used from inside my program that writes files to the CDROM (ATAPI interface) through writer??? Or is there any API or...
3
1533
by: Fabian Braennstroem | last post by:
Hi, I look for an easy way to use the newest scipy, pyvtk, matplotlib, f2py, numpy, paraview/vtk,... on a entreprise redhat machine without administration rights. My first thought was to...
3
1698
by: Klapet | last post by:
Hi, I'm quite new in C++ programing and I want to ask, if I can handle events in simple console-like program. For example I need one loop to repeat until some key is pressed. Is it possible to...
3
9025
by: Ognjen Bezanov | last post by:
Hello, I am trying to control a CD-ROM drive using python. The code I use is shown below.
0
1755
Guido Geurs
by: Guido Geurs | last post by:
I'm writing a program that list the contents of a CDrom and also the contents of the ZIP files. When there is a bad Zip file on the CD, the program keeps traying to reed the file and after +- 50...
0
7124
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
7163
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,...
1
6884
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
7375
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
5460
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,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3090
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
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.