"205" C # for Remote Desktop access

Source: Internet
Author: User
Tags remote desktop access

Reference: Remote Desktop using C#.net

Reference documents: Tscform.zip

This blog is mainly about how to use the Microsoft Terminal Services Client ActiveX Control in the. NET platform to achieve Remote Desktop access.

Practice:

1. Add a reference in Visual Studio, add the Microsoft Terminal Services Control Type Library in COM, and this process will add MSTSCLib.dll to the project 。

2. Add controls to the toolbar, right-click on the toolbar to select "Select items ...", select "Microsoft Terminal Services Client Control" in the COM component, and the corresponding controls will appear, then drag to use.

3. Implementation code: AXMSTSCAXNOTSAFEFORSCRIPTING1 is the name of the control, Str_computer is the IP address, Str_username is the user name, Str_password is the password.

    Axmstscaxnotsafeforscripting1.server = Str_computer;    Axmstscaxnotsafeforscripting1.username = Str_username;    Imstscnonscriptable secured = (imstscnonscriptable) axmstscaxnotsafeforscripting1.getocx ();    Secured. Cleartextpassword = Str_password;    Axmstscaxnotsafeforscripting1.connect ();

"205" C # for Remote Desktop access

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.