Created
September 6, 2011 07:25
-
-
Save SimonCropp/1196839 to your computer and use it in GitHub Desktop.
ResiliencyTests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class ResiliencyTests | |
{ | |
[Test] | |
public void Foo() | |
{ | |
using (var disabledItems = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\14.0\Outlook\Resiliency\DisabledItems")) | |
{ | |
foreach (var valueName in disabledItems.GetValueNames()) | |
{ | |
Debug.WriteLine(valueName); | |
var bytes = (byte[]) disabledItems.GetValue(valueName); | |
var pathLengthAsBytes = bytes.Skip(4).Take(4).ToList(); | |
var pathLength = pathLengthAsBytes[0] | pathLengthAsBytes[1] << 8 | pathLengthAsBytes[2] << 16 | pathLengthAsBytes[3] << 24; | |
var path = Encoding.Unicode.GetString(bytes, 12, pathLength - 2); | |
Debug.WriteLine(path); | |
var alreadyProcessed = 12 + pathLength; | |
if (bytes.Length > alreadyProcessed) | |
{ | |
var friendlyName = Encoding.Unicode.GetString(bytes, alreadyProcessed, bytes.Length - alreadyProcessed); | |
Debug.WriteLine(friendlyName); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment