locked
Access Denied error when using RDP client container(WebView) from C# app RRS feed

  • Question

  • I have a C# app with a webview. Using the following code I am loading a webpage with javascript containing RDP client container.

    var html = await Windows.Storage.PathIO.ReadTextAsync("ms-appx:///Assets/RDPContainer/RDPContainer.html");
    RdpWebView.NavigateToString(html);

    RDPContainer.html source is below

    <!DOCTYPE html>

    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title></title>
         <script type='text/javascript'>
             var desktopWidth = 1024;
             var desktopHeight = 768;
             function ShowRDPClient() {
                 var clientControlObject = document.createElement("object");
                 // Register for ActiveX events.
                 clientControlObject.addEventListener("readystatechange", function (e) {
                     if (clientControlObject.readyState !== 4) {
                     }
                 }, false);

                 clientControlObject.addEventListener("error", function (e) {
                 }, false);
                 clientControlObject.classid = "CLSID:EAB16C5D-EED1-4E95-868B-0FBA1B42C092";
                 clientControlObject.id = "clientControl";
                 clientControlObject.width = desktopWidth;
                 clientControlObject.height = desktopHeight;
                 var bodyRegion = document.getElementsByTagName("body");
                 bodyRegion[0].appendChild(clientControlObject);

                 clientControlObject.Settings.SetRdpProperty("Full Address", "10.198.112.205");
                 clientControlObject.Settings.SetRdpProperty("DesktopWidth", desktopWidth);
                 clientControlObject.Settings.SetRdpProperty("DesktopHeight", desktopHeight);

                 clientControlObject.Connect();
             }
         </script>
    </head>
    <body onload='ShowRDPClient();'>
    </body>
    </html>

    I am getting an "Access denied" exception when setting the classid. If I use the above code in Javascript metro application, it works fine.

    Thanks 


    • Edited by SMNW Tuesday, November 20, 2012 1:00 AM
    Tuesday, November 20, 2012 12:50 AM

Answers

All replies