zoukankan      html  css  js  c++  java
  • 连接服务器方法

    在APP.confge中

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <appSettings>
    <add key="RepositoryAccount" value="sa"/>
    <add key="RepositoryPassword" value="sa"/>
    <add key="RepositoryServer" value="127.0.0.1"/>
    <add key="RepositoryPort" value=" 5060"/>
    </appSettings>
    <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    </configuration>

    代码页

    一、//string UserAccount = ConfigurationManager.AppSettings["RepositoryAccount"];//获取位置文件里的用户登录账号
    //string UserPassword = ConfigurationManager.AppSettings["RepositoryPassword"];//获取位置文件里的用户登录密码
    //string Server = ConfigurationManager.AppSettings["RepositoryServer"];//获取位置文件里的服务器
    //string Port = ConfigurationManager.AppSettings["RepositoryPort"];//获取位置文件里的端口号
    //int port = Convert.ToInt32(Port);

    二、

    string UserAccount = UserName.Text;//获取输入的用户登录账号
    string UserPassword = Password.Text;//获取输入的用户登录密码
    string Server = TBServiceIp.Text;//获取输入的服务器IP
    string Port = TBPort.Text;//获取输入的的端口号
    int port = Convert.ToInt32(Port);

    AMConnection connection = new Gisquest.AM.Interfaces.AMConnection(Server, port);
    connection.Connect(UserAccount, UserPassword);
    clientInterface = new AMClient(connection);
    if(connection!=null)
    {
    MessageBox.Show("连接档案服务成功!!!");

    }

  • 相关阅读:
    kvm虚拟迁移(5)
    kvm虚拟化网络管理(4)
    计算系数
    排列组合
    错排
    加分二叉树
    皇宫看守
    战略游戏
    数字转换
    JDK8 HashMap源码分析
  • 原文地址:https://www.cnblogs.com/ylldbk/p/5544794.html
Copyright © 2011-2022 走看看