Ejemplo n.º 1
0
        /// <summary>
        /// Connects to a Target.
        /// </summary>
        /// <param name="target">The Target to connect to</param>
        /// <param name="addresses">The list of addresses for the target</param>
        /// <returns>The session representing the target connection.</returns>
        public Session ConnectTo(string target, params string[] addresses)
        {
            TargetAddress[] addressObjs = new TargetAddress[addresses.Length];
            for (int i = 0; i < addresses.Length; ++i)
            {
                addressObjs[i] = TargetAddress.Parse(addresses[i]);
            }

            return ConnectTo(target, addressObjs);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the TargetInfo class.
 /// </summary>
 /// <param name="name">The name of the Target</param>
 /// <param name="addresses">The network addresses of the Target</param>
 public TargetInfo(string name, TargetAddress[] addresses)
 {
     _name = name;
     _addresses = addresses;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the Targets available from a Portal (i.e. network entity).
 /// </summary>
 /// <param name="address">The address of the Portal</param>
 /// <returns>The list of Targets available</returns>
 /// <remarks>If you just have an IP address, use this method to discover the available Targets.</remarks>
 public TargetInfo[] GetTargets(TargetAddress address)
 {
     using (Session session = new Session(SessionType.Discovery, null, _userName, _password, new TargetAddress[] { address }))
     {
         return session.EnumerateTargets();
     }
 }