示例#1
0
        public bool Login(string strName, string strPassword, string rep)
        {
            if (rep.Length == 0)
            {
                bLogin = false;
                return(false);
            }

            this.strUserName       = strName;
            this.strPassword       = strPassword;
            this.strRepositoryName = rep;
            var     KeyFileSet = new SAWSKeyFileSet();
            Boolean MustChangePassword;
            int     DaysOfExpiration;
            Boolean Cancelled;
            string  ResultDescription;

            if (0 != sdkObject.Login(strName, strPassword, strDBName, strRepositoryName, KeyFileSet, out MustChangePassword,
                                     out DaysOfExpiration, out Cancelled, out ResultDescription))
            {
                bLogin = false;
                return(false);
            }
            else
            {
                bLogin = true;
                return(!Cancelled);
            }
        }
示例#2
0
        // Login to the server and connect to the specified repository
        public bool ConnectToServer(int orgId, string user, string password, string repo)
        {
            sawObject = new SAWSAppObject();

            long             ResultValue;
            Enum_EncryptType EncryptType;
            // SAWSGlobalMessageSet GlobalMessageSet;
            string PlanName;
            bool   Cancelled;
            string ResultDescription;

            sawObject.SetConnectionType(Enum_ConnectionType.Enum_BroadBandConnection);

            //ResultValue = sawObject.ConnectToServer(

            //    );

            // TODO: connect to server
            ResultValue       = 0;
            ResultDescription = string.Empty;

            //ResultValue = sawObject.ConnectToServer(
            //	orgId,
            //	false,
            //	true,
            //	"",
            //	0,
            //	Enum_ProxyType.Enum_NOPROXY,
            //	"",
            //	0,
            //	"",
            //	"",
            //	out EncryptType,
            //	out GlobalMessageSet,
            //	out PlanName,
            //	out Cancelled,
            //	out ResultDescription);

            Console.WriteLine("Result: {0}, {1}", ResultValue, ResultDescription);
            if (ResultValue == 0)
            {
                bool   MustChangePassword;
                int    DaysOfExpiration;
                bool   Cancelled1;
                string ResultDescription1;

                //sawObject.Login(user, password, repo, out MustChangePassword, out DaysOfExpiration, out Cancelled1, out ResultDescription1);
                sawObject.Login("", "", "", "", new SAWSKeyFileSet(), out MustChangePassword, out DaysOfExpiration, out Cancelled1, out ResultDescription1);

                Console.WriteLine("Login: {0}", ResultDescription1);

                return(true);
            }

            return(false);
        }