NFe.Components.IniFile.Read C# (CSharp) Method

Read() public method

public Read ( string Key, string Section = null ) : string
Key string
Section string
return string
        public string Read(string Key, string Section = null)
        {
            var RetVal = new StringBuilder(255);
            GetPrivateProfileString(Section ?? EXE, Key, "", RetVal, 255, Path);
            return RetVal.ToString();
        }

Usage Example

示例#1
0
        public static EstadoURLConsultaDFe CarregarURLConsultaDFe(string uf)
        {
            string LocalFile = Application.StartupPath + "\\sefaz.inc";
            EstadoURLConsultaDFe estado = new EstadoURLConsultaDFe();

            if (DownloadArquivoURLConsultaDFe())
            {
                var inifile = new IniFile(LocalFile);

                estado.UF = uf;
                estado.UrlNFe = inifile.Read("NF-e", uf);
                estado.UrlCTe = inifile.Read("CT-e", uf);
                estado.UrlNFCe = inifile.Read("NFC-e", uf);
                estado.UrlNFCeH = inifile.Read("NFC-e(h)", uf);
            }

            return estado;
        }