在用户设置路径构造中获取证据eid和哈希值 [英] Get values of evidence eid and hash in user settings path construction

查看:160
本文介绍了在用户设置路径构造中获取证据eid和哈希值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

win应用程序的默认用户设置存储在以下目录中

By default user settings of win application are stored in the following directory

Vista/7

C:\Users\<userId>\AppData\Local\Application Data\<companyname>\appdomainname>_<eid>_<hash>\<verison>

XP

C:\Documents and Settings>\<username>\[Local Settings\]Application Data\<companyname>\appdomainname>_<eid>_<hash>\<verison>

我需要知道如何获取 eid 哈希的值.

I need to know how to get values of eid and hash.

我试图从AppDomain.CurrentDomain.Evidence获取该信息,然后检查从GetHostEnumerator()获得的值,但它们不适合实际的目录路径值.

I'm trying to get that information from the AppDomain.CurrentDomain.Evidence and then check values I'm getting from GetHostEnumerator() but they aren't fit the actual directory path values.

例如,我有以下值

Some.exe_StrongName_fymjkuum4xrf5aopfjlsem3elhvjbgag

但是我从代码中收到的信息是

But the information I recieved from code is

<StrongName version="1"
Key="002400000480000094000000060200000024000052534131000400000100010027BFE9320943DDB4271C78B6B890E7BF02ECAA65585E252D8FBF07888FAAC54D8F8EF25C65061D4F8B904699701BF437F5A69BBDB6A496B989F8FD96853E43C621A84C187AF9EA90C0DAF7F32134A3BD42E94023DBB601C864CA1FF0B5E520CD090A4B90EDB1F95628F750316DBCC9593603E033D72FD67F2707D2670A2D1EB2"
Name="Some"
Version="0.0.0.0"/>

<System.Security.Policy.Url version="1">
<Url>file:///R:/Some/Some.Utilities/bin/Debug/Some.EXE</Url>
</System.Security.Policy.Url>

<System.Security.Policy.Zone version="1">
<Zone>MyComputer</Zone>
</System.Security.Policy.Zone>

<System.Security.Policy.Hash version="2">
<hash algorithm="SHA1"
value="8B19FB026023FE0C239D96EECDDC0266D36B415B"/>
<hash algorithm="SHA256"
value="46AA666701E20EF698ABE20F60CD52162BD0D7B72B43D1B1EB82826E525ACE73"/>
<hash algorithm="MD5"
value="244B4EA2E084F98345FE56FB4460A436"/>
</System.Security.Policy.Hash>

顺便说一句,我的程序集正在签名.可能就是我的钥匙的价值吗?

By the way, my assembly is signing. May be it's the value from my key ?

推荐答案

使用以下代码行,您可以获取应用程序默认情况下将设置文件保存到的位置.从中可以提取eid和哈希值.

You can get the location where the settings file is saved to by default for your application by using the following line of code. From this you could extract the eid and hash.

string configPath = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath;

这篇关于在用户设置路径构造中获取证据eid和哈希值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆