public void Navigate(object sender, string PathToNavigate) { try { PathToNavigate = ShellClassID.IDFromName(PathToNavigate); object obj = PathToNavigate; if (Directory.Exists(PathToNavigate) || PathToNavigate.Contains("::")) { if (ExplorerWindow.ReadyState == tagREADYSTATE.READYSTATE_COMPLETE) { ExplorerWindow.Navigate2(obj); } } } catch (Exception) { } }
public void OnAddressBar_Enter() { string NewPath = Environment.ExpandEnvironmentVariables(AddressBar.Text); if (NewPath.StartsWith("\\")) { return; } if (File.Exists(NewPath) || Directory.Exists(NewPath) || NewPath.Contains("::")) { if (ExplorerWindow.ReadyState == tagREADYSTATE.READYSTATE_COMPLETE) { ExplorerWindow.Navigate2(NewPath); } } }