[C#]Folder aplikacji w AppData

0

Witam,
Dwa pytania, dwa screenshoty ;d

Pierwsze: http://i.imgur.com/fGHvc.jpg
Jak ustawić kompilator, aby folder który tworzy mój program z ustawieniami użytkownika w AppData nie zawierał oprócz nazwy programu jakiś dziwnych hashcodow

Drugie: http://i.imgur.com/Jgpg3.jpg
Po każdej kompilacji i uruchomieniu nowej wersji programu tworzy się nowy folder z ustawieniami dla konkretnej wersji. Da się tak zrobić aby folder był tylko jeden dla najnowszej wersji i zawierał równiesz ustawienia ze starszej (taki upgrade ustawień)?

Pozdro.

0

Odnośnie pytania drugiego: ja to robię w ten sposób, że w ustawieniach zapamiętuje numer wersji i jeżeli stwierdzę przy uruchamianiu że się on zmienił to pobieram ustawienia z poprzedniej wersji. Kod poniżej:

            System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
            Version appVersion = a.GetName().Version;
            string appVersionString = appVersion.ToString();

            if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString())
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.ApplicationVersion = appVersionString;
                Properties.Settings.Default.Save();
            }
0

Hmm myślę, że to jest jakieś rozwiązanie. Później przetestuje.

0

Odnośnie pierwszego pytania, u ciebie tez do folderów programu dokleja się ten dziwny hashcode?

0

tak, też mam nazwy folderów typu projekt.exe_Url_5s2bbethof4bpxucvpfde1wfdgiaejrm. Nie wiem jak to zmienić ale w niczym mi to nie przeszkadza.

0

Cos znalazlem, ale za bardzo nie rozumiem ;d

The user.config file is created in the <c:\Documents and Settings><username>[Local Settings]Application Data<companyname><appdomainname><eid><hash><verison> folder. Where:

  • <c:\Documents and Settings> is the user data directory, either non-roaming (Local Settings above) or roaming.
  • <username> is the user name.
  • <companyname> is the CompanyNameAttribute value, if available. Otherwise, ignore this element.
  • <appdomainname> is the AppDomain.CurrentDomain.FriendlyName. This usually defaults to the .exe name.
  • <eid> is the URL, StrongName, or Path, based on the evidence available to hash.
  • <hash> is a SHA1 hash of evidence gathered from the CurrentDomain, in the following order of preference:
    1. StrongName

    2. URL

      If neither of these is available, use the .exe path.

  • <version> is the AssemblyInfo's AssemblyVersionAttribute setting.

1 użytkowników online, w tym zalogowanych: 0, gości: 1