我同意,如果没有文件记录,你就无法做一些事情;但文件有时会错失、过时或不存在。
Using dotPeek by JetBrains and looking in mscorlib.dll, we see that the following code is used to pull the SubKeyNames:
[SecuritySafeCritical]
Public String[] GetSubKeyNames()
{
this.CheckPermission(RegistryKey.RegistryInternalCheck.CheckKeyReadPermission, (String) null, False, RegistryKeyPermissionCheck.Default);
Return this.InternalGetSubKeyNames();
}
[SecurityCritical]
internal unsafe String[] InternalGetSubKeyNames()
{
this.EnsureNotDisposed();
Int length1 = this.InternalSubKeyCount();
String[] strArray = New String[length1];
If (length1 > 0)
{
Char[] chArray = New Char[256];
fixed (Char* lpName = &chArray[0])
{
For (Int dwIndex = 0; dwIndex < length1; ++dwIndex)
{
Int length2 = chArray.Length;
Int errorCode = Win32Native.RegEnumKeyEx(this.hkey, dwIndex, lpName, ref length2, (Int[]) null, (StringBuilder) null, (Int[]) null, (Long[]) null);
If (errorCode != 0)
this.Win32Error(errorCode, (String) null);
strArray[dwIndex] = New String(lpName);
}
}
}
Return strArray;
}
因此,订单将始终使用<代码>。 RegEnumKeyEx function, documentation :
由于没有订购子钥匙,任何新的子钥匙都将有任意的指数。 这意味着功能可在任何指令中交回子钥匙。
这正是你的明确答案。