Hi, I'm running a program on my IIS server that's written in C# that is
supposed to make screen captures of the server's display.

The problem is that the images that get created are all black although
they are always the right size. I have tried everything from spawning
an exe that takes the screenshots to using window handles to take the
screenshots and all I get are black pictures.

Now I know that the code to take the screenshot is correct because when
I manually run the exe on the server images are displayed correctly but
the same exe displays a black image when run from IIS. Also all of this
code works fine when run on the Microsoft ASP.NET Development Server
which means this problem has something to do with some limitations in
IIS.

I'm not that experienced with IIS so if any experts out there know any
special configurations I have to run IIS under or if anyone knows any
workarounds for this problem please let me know.

Thanks!

Kris

Re: IIS screen capture returns black screen by Chris

Chris
Fri Aug 26 05:12:31 CDT 2005

What are you expecting to see in these screen shots?

The server screen will not display much especially if noone is logged on.


Cheers

Chris

Chris Crowe [IIS MVP]
http://blog.crowe.co.nz


<kris_scheyer@yahoo.com> wrote in message
news:1125043157.737584.186930@g43g2000cwa.googlegroups.com...
> Hi, I'm running a program on my IIS server that's written in C# that is
> supposed to make screen captures of the server's display.
>
> The problem is that the images that get created are all black although
> they are always the right size. I have tried everything from spawning
> an exe that takes the screenshots to using window handles to take the
> screenshots and all I get are black pictures.
>
> Now I know that the code to take the screenshot is correct because when
> I manually run the exe on the server images are displayed correctly but
> the same exe displays a black image when run from IIS. Also all of this
> code works fine when run on the Microsoft ASP.NET Development Server
> which means this problem has something to do with some limitations in
> IIS.
>
> I'm not that experienced with IIS so if any experts out there know any
> special configurations I have to run IIS under or if anyone knows any
> workarounds for this problem please let me know.
>
> Thanks!
>
> Kris
>



Re: IIS screen capture returns black screen by kris_scheyer

kris_scheyer
Fri Aug 26 08:23:21 CDT 2005

Someone will always be logged on to the server because it isn't your
typical server. Its a little box that runs XP embedded on which a
program is always running. The program controls the functions of the
the machine and displays the system status and other data like
measurement results. So what I want to be able to do is have a button
that takes a screenshot of the display on the server and displays it on
the web page.

I hope that helps..

Kris


Re: IIS screen capture returns black screen by Tom

Tom
Fri Aug 26 08:45:21 CDT 2005

<kris_scheyer@yahoo.com> wrote in message
news:1125062601.038290.131720@g14g2000cwa.googlegroups.com...
> Someone will always be logged on to the server because it isn't your
> typical server. Its a little box that runs XP embedded on which a
> program is always running. The program controls the functions of the
> the machine and displays the system status and other data like
> measurement results. So what I want to be able to do is have a button
> that takes a screenshot of the display on the server and displays it on
> the web page.

The code needs to execute in the context of the logged on user - otherwise
you're getting the screen shot of the IIS user (which is probably
IUSR_servername, who of course is not logged on).

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserver2003/community/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS



Re: IIS screen capture returns black screen by kris_scheyer

kris_scheyer
Fri Aug 26 09:08:39 CDT 2005

That makes sense. Thanks I'll look into that!

Kris


Re: IIS screen capture returns black screen by Tom

Tom
Fri Aug 26 13:20:17 CDT 2005

<kris_scheyer@yahoo.com> wrote in message
news:1125065319.414891.317960@g47g2000cwa.googlegroups.com...
> That makes sense. Thanks I'll look into that!

These talk about a similar issues and may shed some light:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q184291
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q288367

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserver2003/community/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS



Re: IIS screen capture returns black screen by kris_scheyer

kris_scheyer
Mon Aug 29 09:10:35 CDT 2005

I found this link:
http://blogs.msdn.com/shawnfa/archive/2004/06/02/146915.aspx
about running programs using different credentials using .net2.0 which
I immediately tried. Well it seems that using ProcessStartInfo to run
programms as a different user through IIS doesn't work either. This is
probably a problem with whidbey though since its still in beta and not
IIS. When I access the page from a remote computer and hit the button
that's supposed to launch the application on the server an error window
appears on the server saying that the application failed to initialise
properly.

Well so much for the easy way.. I guess my next move will have to be
tackling the old school way of starting a process as a different user
using CreateProcessWithLogonW.

Does anyone know any special configuration I should run IIS under that
might help though? I read something about enabling anonymous access or
something like that but I have no idea what it does and where to change
these settings.

Kris