局域网抓屏源码

wang520d 2009-09-27 10:51:39
现在有个DEMO 已经实现了局域网抓屏的功能;
我将源码的服务端改写成WINDOWS服务的形式,安装到客户端机器;其他机器连接截屏老是失败。
如果有这方面的高手帮忙的话;可以加我Q 173178064 我发源码给你;
...全文
267 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lufang_xy73 2009-10-13
  • 打赏
  • 举报
回复
onstart的时候修改注册表
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\你的服务名]
"Type"=dword:00000010
key value+256
比如现在00000010是16+256=272
16精制就是00000110

或者
在ProjectInstaller.cs重写 install() ,Uninstall()方法

public override void Install(IDictionary stateServer)
{
Microsoft.Win32.RegistryKey system,
//HKEY_LOCAL_MACHINE\Services\CurrentControlSet
currentControlSet,
//...\Services
services,
//...\<Service Name>
service,
//...\Parameters - this is where you can put service-specific configuration
config;

try
{
//Let the project installer do its job
base.Install(stateServer);

//Open the HKEY_LOCAL_MACHINE\SYSTEM key
system = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System");
//Open CurrentControlSet
currentControlSet = system.OpenSubKey("CurrentControlSet");
//Go to the services key
services = currentControlSet.OpenSubKey("Services");
//Open the key for your service, and allow writing
service = services.OpenSubKey(this.serviceInstaller1.ServiceName, true);
//Add your service's description as a REG_SZ value named "Description"
service.SetValue("Description","PI实时数据采集:能源--每天8点或20点取一次数据;汽车衡--每天1点取一次数据;设备状态--每分钟取一次数据。");
//(Optional) Add some custom information your service will use...
//允许服务与桌面交互
service.SetValue("Type",0x00000110);
config = service.CreateSubKey("Parameters");
}
catch(Exception e)
{
Console.WriteLine("An exception was thrown during service installation:\n" + e.ToString());
}
}

public override void Uninstall(IDictionary stateServer)
{
Microsoft.Win32.RegistryKey system,
currentControlSet,
services,
service;

try
{
//Drill down to the service key and open it with write permission
system = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System");
currentControlSet = system.OpenSubKey("CurrentControlSet");
services = currentControlSet.OpenSubKey("Services");
service = services.OpenSubKey(this.serviceInstaller1.ServiceName, true);
//Delete any keys you created during installation (or that your service created)
service.DeleteSubKeyTree("Parameters");
//...
}
catch(Exception e)
{
Console.WriteLine("Exception encountered while uninstalling service:\n" + e.ToString());
}
finally
{
//Let the project installer do its job
base.Uninstall(stateServer);
}
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jiangwenhui/archive/2007/10/10/1818693.aspx
wang520d 2009-10-13
  • 打赏
  • 举报
回复
再顶出下水面
wang520d 2009-09-27
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wisest 的回复:]
服务形式抓屏要启用桌面交互的吧。
[/Quote]

麻烦详细说明下
mywisest 2009-09-27
  • 打赏
  • 举报
回复
服务形式抓屏要启用桌面交互的吧。
mywisest 2009-09-27
  • 打赏
  • 举报
回复
我加了。

110,561

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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