Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WwDotNetBridge
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01617874
Message ID:
01617954
Views:
42
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform