// private void initializeRequest() { communication = new Communications(); authentication = new authentication(); authentication.user = config["username"]; authentication.password = config["password"]; requestDirectory = config["requestDirectory"] + "\\Requests\\"; responseDirectory = config["responseDirectory"] + "\\Responses\\"; cnpXmlSerializer = new cnpXmlSerializer(); cnpTime = new cnpTime(); cnpFile = new cnpFile(); }
// private void initializeRequest() { communication = new Communications(config); authentication = new authentication(); authentication.user = config["username"]; authentication.password = config["password"]; requestDirectory = Path.Combine(config["requestDirectory"], "Requests") + Path.DirectorySeparatorChar; responseDirectory = Path.Combine(config["responseDirectory"], "Responses") + Path.DirectorySeparatorChar; cnpXmlSerializer = new cnpXmlSerializer(); cnpTime = new cnpTime(); cnpFile = new cnpFile(); }
// Create a file with name and timestamp if not exists. public virtual string createRandomFile(string fileDirectory, string fileName, string fileExtension, cnpTime cnpTime) { string filePath = null; if (string.IsNullOrEmpty(fileName)) { if (!Directory.Exists(fileDirectory)) { Directory.CreateDirectory(fileDirectory); } fileName = cnpTime.getCurrentTime("MM-dd-yyyy_HH-mm-ss-ffff_") + RandomGen.NextString(8); filePath = fileDirectory + fileName + fileExtension; using (var fs = new FileStream(filePath, FileMode.Create)) { } } else { filePath = fileDirectory + fileName; } return(filePath); }
public void setCnpTime(cnpTime cnpTime) { this.cnpTime = cnpTime; }