2012-12-29 59 views
0

我正在嘗試使用Windows 7登錄屏幕(或切換用戶屏幕)的打印屏幕以在我的應用程序中使用。登錄屏幕中的屏幕捕獲

我不知道該怎麼做,事實上。任何人都可以幫我嗎?

+0

我已經搜索在谷歌這件事,但我只找到了現成的工具... – Victor

+1

http://www.codeproject.com/Articles/39197/Print-Screen-in- C和http://www.geekpedia.com/tutorial181_Capturing-screenshots-usi ng-Csharp.html – KMC

+0

這是否適用於登錄屏幕? – Victor

回答

5

你需要做一個Windows服務,以便它可以運行,即使用戶沒有登錄,看看這個article和更多信息閱讀MSDN ..

的截圖:

ScreenCapture sc = new ScreenCapture(); 
// capture entire screen, and save it to a file 
Image img = sc.CaptureScreen(); 
// display image in a Picture control named imageDisplay 
this.imageDisplay.Image = img; 
// capture this window, and save it 
sc.CaptureWindowToFile(this.Handle,"C:\\temp2.gif",ImageFormat.Gif); 

來源:http://www.developerfusion.com/code/4630/capture-a-screen-shot/

+0

你沒有這種服務的C#源代碼,因爲我不知道VB,這是我第一次創建服務... – Victor

+0

@Victor如果你不能閱讀VB.NET,那麼只需將代碼編譯爲MSIL並且[Reflector](http://www.reflector.net/) )將其顯示爲C#。但是,嚴肅地說,如果你瞭解C#,那麼你應該可以毫無困難地閱讀VB.NET。 – IInspectable

+0

我讀過它,但我在VB中不如在C#中那麼好。我不經常在VB中編程 – Victor