2009-11-19 22 views
5

TS Web Accessと同様のWebアプリケーションを作成して、サーバー上に構成されたリモートアプリケーションのためにrdpファイルをオンザフライで作成したいと考えています。何か案が??オンザフライでRDPファイルを生成

答えて

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: 

単なる文字列として、簡単なようであることを作成します。私たちは、この正確な事をしなければならなかった私は「winposstr」パラメータが何であるか見当がつかない

PS ...

+0

これは完全に罰金ですが、私のRemoteAppのは、デジタル私のRDPファイルに2つの追加のパラメータを追加した証明書で署名されています 1. signscope:S 2.署名:S がどのように私はこれらのパラメータの値を作成することができますこれらはSHA1ハッシュを使っています... ??? –

+0

私はこれらの証明書で何が起こっているのか分かりません。あなたは有効な 'リモートアプリケーション'のRDPを作成してそのsigをコピーできませんか?または毎回異なるシグネチャですか? – Darknight

+0

シグネチャは毎回同じですが、diffを開くことができます。 diffボタンのアプリ、署名はリモートアプリのプログラム名に依存するので、その場で署名を変更することができます。サンプルRDPファイルの内容: –

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 

}

RDPSign.exeは、Windowsの各バージョンで異なることがあることに注意してください。古いバージョンのユーティリティでは、署名の新しい設定は無視されます。

+0

私はアプリの昇格アカウントを使用しなければなりませんでしたこのアイデアをプールする他の投稿が示唆しているように、私はおそらく、このコードを、アプリケーションプールのアイデンティティを永続的に変更するのではなく、昇格した特権を持つマシン上のサービスに移動するつもりです。 – Jason

関連する問題