gladitop / buildserver Goto Github PK
View Code? Open in Web Editor NEWThis is a program for creating your ftp/tcp server for storing data
License: GNU General Public License v3.0
This is a program for creating your ftp/tcp server for storing data
License: GNU General Public License v3.0
When loading this json file
{
"startProgram": true,
"autoStart": false,
"normalStart": true,
"listServer": [
{
"nameServer": "Test",
"ver": "1.0",
"pathServer": "\n/user/lol",
"descriptionServer": "des a server!"
},
{
"nameServer": "Test 2",
"ver": "2.0",
"pathServer": "Tester2/lol",
"descriptionServer": "2 des"
}
]
}
This error is occurring: Unexpected character encountered while parsing value
Code a class XML
[Serializable]
public class SettingsXmlFtp
{
//[XmlArray("serverXmlsList")]
//public List<ServerXmlFtp> serverXmls = new List<ServerXmlFtp>();
//public int lol { get; set; } = 0;
public SettingsXmlFtp(Settings.listServer listServer)
{
DescriptionServer = listServer.descriptionServer;
RootNameFolder = listServer.nameServer;
RootPlaceFolder = listServer.pathServer;
Passworld = listServer.passworld;
Ver = listServer.ver;
PathCertificate = listServer.pathCertificate;
PassworldCertificate = listServer.passworldCertificate;
TypeConnect = Settings.TypeConnect.FTP;// !!!
User = listServer.user;
MaxConnections = listServer.maxConnections;
Port = listServer.port;
}
[XmlElement("descriptionServer")]
public string DescriptionServer { get; set; } = null;
[XmlElement("rootNameFolder")]
public string RootNameFolder { get; set; } = null;
[XmlElement("rootPlaceFolder")]
public string RootPlaceFolder { get; set; } = null;
[XmlElement("passworld")]
public string Passworld { get; set; } = null;
[XmlElement("ver")]
public string Ver { get; set; } = null;
[XmlElement("pathCertificate")]
public string PathCertificate { get; set; } = null;
[XmlElement("passworldCertificate")]
public string PassworldCertificate { get; set; } = null;
[XmlElement("typeConnect")]
public Settings.TypeConnect? TypeConnect { get; set; } = null; //Этот класс только для FTP (но без этого не куда!)
[XmlElement("user")]
public string User { get; set; } = null;
[XmlElement("maxConnections")]
public int MaxConnections { get; set; } = 0;
[XmlElement("port")]
public int Port { get; set; } = 0;
}
[Serializable]
XML Serialize
public void Import(SettingsXmlFtp settings)//Save
{
XmlSerializer xml = new XmlSerializer(typeof(SettingsXmlFtp));
using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate))
{
xml.Serialize(fs, settings); // тут баг!
//он не имеет беспараметрического конструктора
}
}
Description exception
it does not have a parameterless constructor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.