コード例 #1
0
ファイル: Service.svc.cs プロジェクト: Olexyy/RemoteDrive
 public bool Logout()
 {
     if (this.LoggedIn())
     {
         this.PathResolver = null;
         this.User         = null;
         return(true);
     }
     return(false);
 }
コード例 #2
0
ファイル: Service.svc.cs プロジェクト: Olexyy/RemoteDrive
        public User Login(string mail, string pass)
        {
            string hash = Hashing.GetHashString(pass);

            this.User = new Db().Users.Where(i => i.Email == mail && i.Pass == hash).FirstOrDefault();
            if (this.LoggedIn())
            {
                this.PathResolver = new RemoteDrivePath(this.User.Root);
                if (!Directory.Exists(this.PathResolver.HostPath))
                {
                    Directory.CreateDirectory(this.PathResolver.HostPath);
                }
                if (!Directory.Exists(this.PathResolver.UserPath))
                {
                    Directory.CreateDirectory(this.PathResolver.UserPath);
                }
            }
            return(this.User);
        }