How to provide user name and password when connecting to a network share

When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided. I know how to do this with Win32 functions (the WNet* family from mpr.dll), but would like to do it with .Net (2.0) functionality. What options … Read more

Bring a window to the front in WPF

How can I bring my WPF application to the front of the desktop? So far I’ve tried: SwitchToThisWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle, true); SetWindowPos(new WindowInteropHelper(Application.Current.MainWindow).Handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetForegroundWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle); None of which are doing the job (Marshal.GetLastWin32Error() is saying these operations completed successfully, and the P/Invoke attributes for each definition do have … Read more

How do you configure an OpenFileDialog to select folders?

In VS .NET, when you are selecting a folder for a project, a dialog that looks like an OpenFileDialog or SaveFileDialog is displayed, but is set up to accept only folders. Ever since I’ve seen this I’ve wanted to know how it’s done. I am aware of the FolderBrowserDialog, but I’ve never really liked that … Read more

Is it possible to “decompile” a Windows .exe? Or at least view the Assembly?

A friend of mine downloaded some malware from Facebook, and I’m curious to see what it does without infecting myself. I know that you can’t really decompile an .exe, but can I at least view it in Assembly or attach a debugger? Edit to say it is not a .NET executable, no CLI header. 16 … Read more