コード例 #1
0
        private string GetDataDirLocation()
        {
            Assembly thisAssembly     = Assembly.GetCallingAssembly();
            CommonApplicationData cad = new CommonApplicationData(thisAssembly, allUsers: false);

            return(cad.ApplicationFolderPath);
        }
コード例 #2
0
        private void SetDataDirLocation()
        {
            Assembly thisAssembly     = Assembly.GetEntryAssembly();
            CommonApplicationData cad = new CommonApplicationData(thisAssembly, allUsers: false);

            AppDomain.CurrentDomain.SetData("DataDirectory", cad.ApplicationFolderPath);
        }