Ejemplo n.º 1
0
        /*[WebMethod]
        public string Login(string strUsername, string strPassword)
        {
            string strPathName = @"D:\Userlogin.txt";
            string resp="done";
            try
            {
        //            ServiceMethods obje = new ServiceMethods();
            StreamWriter sw =  new StreamWriter(strPathName, true);
            sw.WriteLine("UserName	: "******"Password	: "******"Time		: " + DateTime.Now.ToLongTimeString());
            sw.WriteLine("Date		: " + DateTime.Now.ToShortDateString());
            sw.WriteLine("-------------------------------------------------------------------");
            sw.Flush();
            sw.Close();
                return resp;
            }
            catch (Exception ex)
            {
              return ex.Message;
            }

         //   string val = obje.EnterUserPassword(strUsername, strPassword);
           // return val;
            //if ((strUsername == "sopra") && (strPassword == "123"))
            //    return true;
            //else
            //    return false;

        }*/
        public string GetVideoPath(string userName, string password)
        {
            Users objUser = new Users();
            UserManager objUserManager = new UserManager();
            objUser.UserName = userName;
            objUser.Password = Security.EncryptSymmetric(password);
            if (objUserManager.CheckForLogin(objUser) > 0)
            {
                string path = GetPath(userName);
                DirectoryInfo objDir = new DirectoryInfo(path);
                if (!objDir.Exists)
                    objDir.Create();
                return path;
                //return "<tributeservice><path>c:\\</path><pid>100</pid></tributeservice>";
            }
            else
            {
                return "error";
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Method to check username and password
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 private int CheckUser(string userName, string password)
 {
     Users objUser = new Users();
     UserManager objUserManager = new UserManager();
     objUser.UserName = userName;
     objUser.Password = Security.EncryptSymmetric(password);
     return objUserManager.CheckForLogin(objUser);
 }