dos 下如何保存当前屏幕的内容

andylyc 2008-02-19 01:02:45
必须在DOS下用命令自动实现,高手们指点下,谢谢
...全文
165 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
kanji 2008-02-20
  • 打赏
  • 举报
回复
既然写了要.NET Framework支持,如何在DOS下实现?


楼主还是参考这个吧
http://cskyer.bokee.com/4169863.html
ljc007 2008-02-20
  • 打赏
  • 举报
回复
纯DOS命令是无法实现的
网上的一段代码参考一下吧

[code=BatchFile]@echo off
rem 需要 .NET Framework 支持
set "dnfpath=%systemroot%\Microsoft.NET\Framework"
for /f "delims=" %%v in ('dir /ad /b %dnfpath%\v?.*') do (
if exist "%dnfpath%\%%v\csc.exe" set "cscpath=%dnfpath%\%%v\csc.exe"
)
< "%~f0" more +15 > "%temp%\estCapture.cs"
%cscpath% /out:"%cd%\estCapture.exe" "%temp%\estCapture.cs" 1>nul
estCapture.exe
start estCapture.bmp
ping -n 2 127.1 1>nul
del estCapture.exe

goto:eof

:estCapture

using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;

public class MyClass
{
public static void Main()
{
Image img = new Bitmap(Screen.AllScreens[0].Bounds.Width, Screen.AllScreens[0].Bounds.Height);
Graphics g = Graphics.FromImage(img);
g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.AllScreens[0].Bounds.Size);
img.Save("estCapture.bmp", ImageFormat.Bmp);
}
} [/code]
qhmming 2008-02-19
  • 打赏
  • 举报
回复
请说明白一点!!
lslsyqyq 2008-02-19
  • 打赏
  • 举报
回复
相机拍下来


呵呵 帮顶下

6,871

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧