示例#1
0
        //
        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();
        }
示例#2
0
        //
        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();
        }
示例#3
0
        // 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);
        }
示例#4
0
 public void setCnpTime(cnpTime cnpTime)
 {
     this.cnpTime = cnpTime;
 }