예제 #1
0
        /*
         * Returns the SFTP file attributes.
         */
        private string GetSftpFileAttributes(SftpFileAttributes sftpAttrs)
        {
            var permissions = sftpAttrs.GetBytes().ToString();

            return("Permissions: " + permissions
                   + " | UserID: " + sftpAttrs.UserId
                   + " | GroupID: " + sftpAttrs.GroupId
                   + " | Size: " + sftpAttrs.Size
                   + " | LastEdited: " + sftpAttrs.LastWriteTime.ToString());
        }
예제 #2
0
        public void Init()
        {
            var random = new Random();

            _protocolVersion = (uint)random.Next(0, int.MaxValue);
            _requestId       = (uint)random.Next(0, int.MaxValue);
            _handle          = new byte[random.Next(1, 10)];
            random.NextBytes(_handle);
            _attributes      = SftpFileAttributes.Empty;
            _attributesBytes = _attributes.GetBytes();
        }
예제 #3
0
        public void Init()
        {
            var random = new Random();

            _protocolVersion = (uint)random.Next(0, int.MaxValue);
            _requestId       = (uint)random.Next(0, int.MaxValue);
            _encoding        = Encoding.Unicode;
            _path            = random.Next().ToString(CultureInfo.InvariantCulture);
            _pathBytes       = _encoding.GetBytes(_path);
            _attributes      = SftpFileAttributes.Empty;
            _attributesBytes = _attributes.GetBytes();
        }