Eject CD in a ASP.NET process

Last post 05-25-2008 6:00 AM by violtomte. 2 replies.

Sort Posts:

  • Eject CD in a ASP.NET process

    05-13-2008, 6:49 PM
    • Member
      point Member
    • violtomte
    • Member since 05-13-2008, 6:47 PM
    • Posts 2

    Hello, I have recently moved a few console utility programs to a web program (using visual webgui). In one of these programs I index a dvdr and then eject it. This worked very well in the console application, using P/Invoke to DeviceIOControl in kernel32.dll, mciSendString in winmm.dll and also by invoking cdr.exe from here: http://www.codeguru.com/cpp/w-p/system/cd-rom/article.php/c5775/ However when running in the ASP.NET process the disc is not ejected by any of these methods, so I figure there must be some security issue. My question is if there is any workaround or do I have to have a running process (say a service) running as another User (that can eject the cd) and use remoting or is there some way to configure what the ASP.NET process can do? In IIS (I'm running IIS7 on a Vista x64) the web page has the highest security credentials. Regards

  • Re: Eject CD in a ASP.NET process

    05-24-2008, 2:58 PM

    Try using ASP.NET impersonation: http://msdn.microsoft.com/en-us/library/xh507fc5.aspx

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Eject CD in a ASP.NET process

    05-25-2008, 6:00 AM
    • Member
      point Member
    • violtomte
    • Member since 05-13-2008, 6:47 PM
    • Posts 2

     Thanks, but sadly it didn't work (either with or without username/password in the impersionation). Using CreateFile/DeviceIOControl I get Access Denied, the other mehods silently quit without opening the tray.

Page 1 of 1 (3 items)