6

我想创建一个类似于 TS Web Access 的 Web 应用程序,我可以在其中为服务器上配置的远程应用程序动态创建 rdp 文件。任何想法??

4

2 回答 2

2

我们必须做这件事。

private void InvokeRDPSign(String fileName, String certificateThumbPrint)
{
    Process signingProcess = new Process();
    signingProcess.StartInfo.FileName = @"rdpsign.exe";

    String arguments = String.Format("/sha1 {0} {1}", certificateThumbPrint, fileName);
    signingProcess.StartInfo.Arguments = arguments;
    signingProcess.StartInfo.UseShellExecute = false;
    signingProcess.StartInfo.RedirectStandardOutput = true;
    signingProcess.StartInfo.WorkingDirectory = Environment.SystemDirectory;
    signingProcess.Start();

    String signingOutput = signingProcess.StandardOutput.ReadToEnd();
    signingProcess.WaitForExit();
    int exitCode = signingProcess.ExitCode;
    //TODO:  should we throw an error if the exitcode is not 0
}

请注意,每个版本的 Windows 上的 RDPSign.exe 都不同。您会发现该实用程序的旧版本将忽略签名中的新设置。

于 2011-03-11T07:04:40.647 回答
1

好吧,看了一个“rdp”文件,这是内容:

screen mode id:i:2
desktopwidth:i:1280
desktopheight:i:768
session bpp:i:32
winposstr:s:2,3,1430,104,2230,704
compression:i:1
keyboardhook:i:2
displayconnectionbar:i:1
disable wallpaper:i:1
disable full window drag:i:1
allow desktop composition:i:0
allow font smoothing:i:0
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s: [YOUR IP]
audiomode:i:0
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards:i:1
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:1
drivestoredirect:s:

只需将其创建为字符串,看起来很简单。

ps我不知道'winposstr'参数是什么......

于 2009-11-19T09:51:29.197 回答