1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace NetworkRemoteControlLib
- {
- /// <summary>
- /// 主机信息项
- /// </summary>
- public class ConnectionItem
- {
- public ConnectionItem() {
- }
- //public ConnectionItem(string connString)
- //{
- // try
- // {
- // string[] connStrs = connString.Split('|');
- // this.DescriptionName = LYFZ.WinAPI.SDKSecurity.Encode16Hex(connStrs[0]);
- // this.HostNameIP = LYFZ.WinAPI.SDKSecurity.Encode16Hex(connStrs[1]);
- // this.HostPort = Convert.ToInt32(connStrs[2]);
- // this.DescriptionInformation = LYFZ.WinAPI.SDKSecurity.Encode16Hex(connStrs[3]);
- // }
- // catch { }
- //}
- public ConnectionItem(string dName,string hostNameIP,int hPort=4500,string desc="")
- {
- this.DescriptionName = dName;
- this.HostNameIP = hostNameIP;
- this.DescriptionInformation = desc;
- this.HostPort = hPort;
- }
- public int HostPort { set; get; } = 4500;
- /// <summary>
- /// 主机描述名称
- /// </summary>
- public string DescriptionName { get; set; } = "未命名";
- /// <summary>
- /// 主机名或IP
- /// </summary>
- public string HostNameIP { get; set; } = "127.0.0.1";
- /// <summary>
- /// 主机描述说明
- /// </summary>
- public string DescriptionInformation { get; set; } = "";
- public override string ToString()
- {
- return $"{DescriptionName}[{HostNameIP}:{HostPort.ToString()}]";
- }
- //public string ToSaveString()
- //{
- // return $"{LYFZ.WinAPI.SDKSecurity.Encode16Hex(this.DescriptionName)}|{LYFZ.WinAPI.SDKSecurity.Encode16Hex(this.HostNameIP)}|{this.HostPort.ToString()}|{LYFZ.WinAPI.SDKSecurity.Encode16Hex(this.DescriptionInformation)}";
- //}
- }
- }
|