Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WwDotNetBridge
Message
 
 
À
07/04/2015 11:58:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01617874
Message ID:
01617954
Vues:
39
>Not sure but I think the ini should be in the same folder as the VFP exe.......
>
The code is the following:
/// <summary>
    /// The Ini Files are named using AppInfo.IniName (or AppInfo.ModuleName if the IniName isn't set)
    /// </summary>
    public class LocalIni : IniFile
    {
        public LocalIni()
            : base(System.IO.Path.Combine(Directory.GetLocalDirectory(true), AppInfo.IniName + @".ini"))
        {
            //local path (ProgramData)
        }
    }
where GetLocalDirectory method is this:
 static public string GetLocalDirectory(bool bCheck = false)
        {
            SystemIni iniS = new SystemIni();
            string sLocalDir = iniS.GetString("Data", "ProgramDataPath", "");
            //do check for %PROGRAMDATA%... 
            sLocalDir = sLocalDir.Replace("%PROGRAMDATA%", System.Environment.GetEnvironmentVariable("programdata"));
            if (sLocalDir.Length == 0)
            {
                //assume it's programdata...
                sLocalDir = System.Environment.GetEnvironmentVariable("programdata") + @"\Siriusware\" + AppInfo.DirectoryName;
            }
            if (bCheck)
                CheckDirectory(ref sLocalDir);
            return sLocalDir;
        }
Right now I'm just testing from the program (.prg) in VFP, so perhaps the ini file needs to be c:\program data\siriusware\Visual FoxPro\Visual FoxPro.ini

But I'm going to try Paul's method to be sure.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform