コード例 #1
0
ファイル: ConnectDialog.cs プロジェクト: rtjust/PastProjects
 /// <summary>
 /// Creates an instance of ConnectDialog and uses it to obtain the name of the VNC Host.
 /// </summary>
 /// <returns>Returns the VNC Host name entered by the user, or null if he/she clicked Cancel.</returns>
 public static string GetVncHost()
 {
     using(ConnectDialog dialog = new ConnectDialog()) {
         if (dialog.ShowDialog() == DialogResult.OK) {
             return dialog.Host;
         } else {
             // If the user clicks Cancel, return null and not the empty string.
             return null;
         }
     }
 }
コード例 #2
0
ファイル: ConnectDialog.cs プロジェクト: ValdemirBSJr/C_SHARP
 /// <summary>
 /// Creates an instance of ConnectDialog and uses it to obtain the name of the VNC Host.
 /// </summary>
 /// <returns>Returns the VNC Host name entered by the user, or null if he/she clicked Cancel.</returns>
 public static string GetVncHost()
 {
     using (ConnectDialog dialog = new ConnectDialog()) {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             return(dialog.Host);
         }
         else
         {
             // If the user clicks Cancel, return null and not the empty string.
             return(null);
         }
     }
 }