XP/2003下使用Delphi方法开放3389

[复制链接]
查看345 | 回复0 | 2012-4-1 19:20:09 | 显示全部楼层 |阅读模式
修改注册表一个键值复制内容到剪贴板代码:

programOpen3389;

{$APPTYPECONSOLE}

uses

   SysUtils,Registry,Windows;

var

reg:TRegistry;

procedureHelp;

begin

   writeln('');

   writeln('======WinXP&2003Open3389bylanyu======');

   Writeln('Useag'+ExtractFileName(Paramstr(0))+'[/n]');

end;

begin

   {TODO-oUser-cConsoleMain:Insertcodehere}

   ifParamCount>2then

   begin

     help;

     exit;

   end;

   reg:=TRegistry.Create;

   reg.RootKey:=HKEY_LOCAL_MACHINE;

   reg.OpenKey('SYSTEM\CurrentControlSet\Control\TerminalServer',true);

   ifParamCount=1then

   begin

   ifParamstr(1)='/n'then

   begin

     try

       reg.WriteBool('fDenyTSConnections',true);

       Writeln('Close3389succes单机传奇ully');

     except

       Writeln('Close3389fail');

     end;

   end

   else

     begin

       Help;

       Exit;

     end;

   end

   else

   begin

     try

       reg.WriteBool('fDenyTSConnections',false);

       writeln('Open3389succes单机传奇ully');

     except

       writeln('Open3389fail');

     end;

   end;

   reg.Free;

end.

 
*
*
发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则