动态生成RDP文件 [英] Generating RDP file on the fly
本文介绍了动态生成RDP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个类似于TS Web Access的Web应用程序,在其中我可以为服务器上配置的Remote Apps即时创建rdp文件.有什么想法吗?
I want to create a web application similar to TS Web Access, where I can create rdp files on the fly for Remote Apps configured on the server. Any idea??
推荐答案
我们必须做到这一点.
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都不相同.您会发现该实用程序的较旧版本将忽略签名中的较新设置.
Be aware that that the RDPSign.exe is different on each version of windows. You will find that an older version of the utility will ignore newer settings from the signature.
这篇关于动态生成RDP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文