title: How does one use OpenFileDialog in C# in visual Studio 2010
body: <p>I have written a custom dialog (form) that I can use in a C# program that behaves much like a "File - Open" menu command and brings up a window where a user can select a file or directory.</p>
  
  <p>The question I have is this.  It has "My Computer" as its root.  How can I have it so that it searches on a Network?  If the file or directory is located on a network.</p>
  
  <p>Or better yet, in Visual Studio 2010, is there some sort of canned FileOpenDialog that I can use right away?</p>
  
  <p>I tried calling the OpenFileDialog as described in the example code at
  <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx</a>
  but the compiler does not seem to like <code>DialogResult.OK</code> as used in this line of code:</p>
  
  <pre><code>if(openFileDialog1.ShowDialog() == DialogResult.OK)
  </code></pre>
  
  <p>The compiler says:</p>
  
  <blockquote>
    <p>Error 1   'System.Nullable' does not contain a definition for 'OK' and no extension method 'OK' accepting a first argument of type 'System.Nullable' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>I tried using the namespace Microsoft.Win32 instead of System.Windows.Forms and neither worked.  They both produced this error.</p>