public void Write(FileZilla3 zilla, string path) { using (var s = new FileStream(path, FileMode.OpenOrCreate)) { Write(zilla, s); } }
public static FileZilla3 Convert(publishData data) { var profile = data.publishProfile.First(p => p.publishMethod == PublishMethod.FTP); Uri uri = new Uri(profile.publishUrl); var zilla = new FileZilla3 { Servers = new FileZilla3Servers { Server = new FileZilla3ServersServer { Host = uri.Host, Port = uri.Port, Name = profile.profileName, User = profile.userName, Pass = new FileZilla3ServersServerPass { Value = ToBase64(profile.userPWD), encoding = "base64", }, Comments = @"Generated by PubProfileToFilezilla on https://github.com/jquintus/ConsoleProjects/tree/master/PubProfileToFilezilla", Protocol = 0, Type = 0, Logontype = 1, TimezoneOffset = 0, PasvMode = "MODE_DEFAULT", MaximumMultipleConnections = 0, EncodingType = "Auto", BypassProxy = 0, SyncBrowsing = 0, } } }; return(zilla); }
public void Write(FileZilla3 zilla, Stream s) { XmlSerializer serializer = new XmlSerializer(typeof(FileZilla3)); serializer.Serialize(s, zilla); }