/[AnywhereTS-MSSQL]/trunk/TSAdminTool/frmAddTFTP.cs
ViewVC logotype

Annotation of /trunk/TSAdminTool/frmAddTFTP.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations) (download)
Wed Jul 11 14:19:13 2012 UTC (7 years, 10 months ago) by william
File size: 2688 byte(s)
imported from https://anywherets.svn.sourceforge.net/svnroot/anywherets/trunk/
Revision: 1
Author: beartown
Date: 3:10:40 AM, Monday, June 21, 2010
Message:
First upload. Still todo in order to get a fully working product: Replace Thinstation images with vanilla Thinstation, modify ImageDesigntimeConfig.cs, ImageRuntimeConfig.cs in order to support the Thinstation image
1 william 4 using System;
2     using System.Collections.Generic;
3     using System.ComponentModel;
4     using System.Data;
5     using System.Drawing;
6     using System.Text;
7     using System.Windows.Forms;
8     using System.IO;
9    
10     namespace AnywhereTS
11     {
12     public partial class frmAddTFTP : Form
13     {
14     public string inputstring; // The text in the input box
15     public frmAddTFTP()
16     {
17     InitializeComponent();
18     }
19    
20     private void btnOk_Click(object sender, EventArgs e)
21     {
22     inputstring = textInput.Text.Trim();
23    
24     // Check that user entered something
25     if (inputstring.Length == 0)
26     {
27     this.Cursor = Cursors.Default;
28     MessageBox.Show("You must specifiy a directory.");
29     textInput.Focus();
30     return;
31     }
32    
33     // Check if path is relative
34     if (inputstring.StartsWith(".") || (inputstring.StartsWith(@"\") && !inputstring.StartsWith(@"\\")))
35     {
36     this.Cursor = Cursors.Default;
37     MessageBox.Show("Invalid path.");
38     textInput.Focus();
39     return;
40     }
41    
42     // Validate directory
43     if (!Directory.Exists(inputstring))
44     {
45     MessageBox.Show("Cannot find or access directory '" + inputstring + "' Please check spelling and rights!");
46    
47     textInput.SelectAll();
48     textInput.Focus();
49     return;
50     }
51    
52     DialogResult = DialogResult.OK;
53     }
54    
55     private void btnBrowse_Click(object sender, EventArgs e)
56     {
57     // Show the FolderBrowserDialog.
58    
59     Rebrowse:
60     DialogResult result = folderBrowserDialog.ShowDialog();
61     if (result == DialogResult.OK)
62     {
63     string strPath; // The path provided by the user
64    
65     // Browse to a folder by displaying the folder browse Dialog
66     try
67     {
68     strPath = folderBrowserDialog.SelectedPath.Trim();
69     }
70     catch (NotSupportedException)
71     { // User has browsed to a non folder
72     MessageBox.Show("Object is not a file folder.");
73     goto Rebrowse;
74     }
75     textInput.Text = strPath;
76     textInput.Select();
77     }
78    
79     }
80    
81     private void frmAddTFTP_Load(object sender, EventArgs e)
82     {
83     helpProvider.HelpNamespace = ATSGlobals.strHelpFilePath; // Initiate helpProvider
84     }
85     }
86     }

  ViewVC Help
Powered by ViewVC 1.1.22