コード例 #1
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public override void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     base.Serialize(writer, protocolVersion, index);
     writer.WriteText(UserName);
     writer.WriteText(Password);
     if (protocolVersion >= ProtocolVersions.Sha512)
     {
         writer.WriteText(Salt);
     }
 }
コード例 #2
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     writer.WriteText(Directory);
     writer.WriteTextList(Aliases);
     writer.WriteBigEndianInt16((ushort)AccessRights);
 }
コード例 #3
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public virtual void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     writer.WriteText(GroupName);
     writer.Write(IpLimit);
     writer.Write(UserLimit);
     byte options = (byte)(((byte)BypassUserLimit & 0x3) | ((byte)Enabled << 2));
     writer.Write(options);
     writer.WriteTextList(DisallowedIPs);
     writer.WriteTextList(AllowedIPs);
     writer.Write(EightPlusThree);
     writer.WriteList16(SharedFolders, protocolVersion);
     writer.Write(DownloadSpeedLimit, protocolVersion);
     writer.Write(UploadSpeedLimit, protocolVersion);
     writer.WriteText(Comment);
     writer.Write(ForceSsl);
 }
コード例 #4
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public override void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     base.Serialize(writer, protocolVersion, index);
     writer.WriteText(UserName);
     writer.WriteText(Password);
 }
コード例 #5
0
        /// <summary>
        /// Serialise object into FileZilla binary data
        /// </summary>
        /// <param name="writer">Binary writer to write data to</param>
        /// <param name="protocolVersion">Current FileZilla protocol version</param>
        /// <param name="index">The 0 based index of this item in relation to any parent list</param>
        public virtual void Serialize(BinaryWriter writer, int protocolVersion, int index)
        {
            // Switch user Enabled 'Default' to 'Yes' when not assigned a group.
            if (Enabled == TriState.Default && GetType() == typeof(User) && string.IsNullOrEmpty(GroupName))
                Enabled=TriState.Yes;

            writer.WriteText(GroupName);
            writer.Write(IpLimit);
            writer.Write(UserLimit);
            byte options = (byte)(((byte)BypassUserLimit & 0x3) | ((byte)Enabled << 2));
            writer.Write(options);
            writer.WriteTextList(DisallowedIPs);
            writer.WriteTextList(AllowedIPs);
            if (protocolVersion < ProtocolVersions.Sha512)
            {
                writer.Write(EightPlusThree);
            }
            writer.WriteList16(SharedFolders, protocolVersion);
            writer.Write(DownloadSpeedLimit, protocolVersion);
            writer.Write(UploadSpeedLimit, protocolVersion);
            writer.WriteText(Comment);
            writer.Write(ForceSsl);
        }