frmSelection.cs
上传用户:hkhxjs
上传日期:2008-11-25
资源大小:155k
文件大小:15k
源码类别:

Internet/网络编程

开发平台:

C#

  1. namespace Listener
  2. {
  3. // Library includes
  4.     using System;
  5.     using System.Drawing;
  6.     using System.Collections;
  7.     using System.ComponentModel;
  8.     using System.Windows.Forms;
  9. using System.Windows.Forms.Design;
  10. using System.Text;
  11. using System.IO;
  12.     ///    Share Files/Folders form class.
  13.     public class frmSelection : System.Windows.Forms.Form
  14.     {
  15. private System.ComponentModel.IContainer components;
  16. private System.Windows.Forms.Label lbCopyright;
  17. private System.Windows.Forms.Button btnBrowseFileFolder;
  18. private System.Windows.Forms.ToolTip toolTipText;
  19. private System.Windows.Forms.CheckBox chkEntry;
  20. private System.Windows.Forms.RadioButton rbWrite;
  21. private System.Windows.Forms.RadioButton rbRead;
  22. private System.Windows.Forms.GroupBox grpRights;
  23. private System.Windows.Forms.OpenFileDialog FileOpenDialog;
  24. private System.Windows.Forms.Button btnCancel;
  25. private System.Windows.Forms.Button btnOK;
  26. private System.Windows.Forms.Label label2;
  27. private System.Windows.Forms.TextBox txtFoldername;
  28. private System.Windows.Forms.Button btnBrowse;
  29. private System.Windows.Forms.Label label1;
  30. private System.Windows.Forms.TextBox txtFilename;
  31. private System.Windows.Forms.TabPage tpFolder;
  32. private System.Windows.Forms.TabPage tpShare;
  33. private System.Windows.Forms.OpenFileDialog openFileDialog1;
  34. private System.Windows.Forms.TabControl tabShare;
  35.         public frmSelection() { InitializeComponent(); }
  36.         // Free resources it was using.
  37.         public override void Dispose()
  38.         {
  39.             base.Dispose();
  40.             components.Dispose();
  41.         }
  42. /// Required method for Designer support - do not modify
  43.         /// the contents of this method with the code editor.
  44.         private void InitializeComponent()
  45. {
  46. this.components = new System.ComponentModel.Container();
  47. this.grpRights = new System.Windows.Forms.GroupBox();
  48. this.rbWrite = new System.Windows.Forms.RadioButton();
  49. this.rbRead = new System.Windows.Forms.RadioButton();
  50. this.chkEntry = new System.Windows.Forms.CheckBox();
  51. this.toolTipText = new System.Windows.Forms.ToolTip(this.components);
  52. this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
  53. this.label1 = new System.Windows.Forms.Label();
  54. this.label2 = new System.Windows.Forms.Label();
  55. this.tpShare = new System.Windows.Forms.TabPage();
  56. this.btnBrowse = new System.Windows.Forms.Button();
  57. this.txtFilename = new System.Windows.Forms.TextBox();
  58. this.tabShare = new System.Windows.Forms.TabControl();
  59. this.tpFolder = new System.Windows.Forms.TabPage();
  60. this.btnBrowseFileFolder = new System.Windows.Forms.Button();
  61. this.txtFoldername = new System.Windows.Forms.TextBox();
  62. this.btnOK = new System.Windows.Forms.Button();
  63. this.FileOpenDialog = new System.Windows.Forms.OpenFileDialog();
  64. this.lbCopyright = new System.Windows.Forms.Label();
  65. this.btnCancel = new System.Windows.Forms.Button();
  66. this.grpRights.SuspendLayout();
  67. this.tpShare.SuspendLayout();
  68. this.tabShare.SuspendLayout();
  69. this.tpFolder.SuspendLayout();
  70. this.SuspendLayout();
  71. // 
  72. // grpRights
  73. // 
  74. this.grpRights.Controls.AddRange(new System.Windows.Forms.Control[] {
  75. this.rbWrite,
  76. this.rbRead});
  77. this.grpRights.Location = new System.Drawing.Point(16, 128);
  78. this.grpRights.Name = "grpRights";
  79. this.grpRights.Size = new System.Drawing.Size(124, 56);
  80. this.grpRights.TabIndex = 3;
  81. this.grpRights.TabStop = false;
  82. this.grpRights.Text = "Rights";
  83. // 
  84. // rbWrite
  85. // 
  86. this.rbWrite.Location = new System.Drawing.Point(6, 36);
  87. this.rbWrite.Name = "rbWrite";
  88. this.rbWrite.Size = new System.Drawing.Size(96, 14);
  89. this.rbWrite.TabIndex = 3;
  90. this.rbWrite.Text = "Read/Write";
  91. this.toolTipText.SetToolTip(this.rbWrite, "Allows the user to upload to this file or folder");
  92. // 
  93. // rbRead
  94. // 
  95. this.rbRead.Checked = true;
  96. this.rbRead.Location = new System.Drawing.Point(6, 16);
  97. this.rbRead.Name = "rbRead";
  98. this.rbRead.Size = new System.Drawing.Size(95, 14);
  99. this.rbRead.TabIndex = 2;
  100. this.rbRead.TabStop = true;
  101. this.rbRead.Text = "Read only";
  102. this.toolTipText.SetToolTip(this.rbRead, "Allows the user to read");
  103. // 
  104. // chkEntry
  105. // 
  106. this.chkEntry.Location = new System.Drawing.Point(296, 128);
  107. this.chkEntry.Name = "chkEntry";
  108. this.chkEntry.Size = new System.Drawing.Size(120, 16);
  109. this.chkEntry.TabIndex = 4;
  110. this.chkEntry.Text = "Add this entry only";
  111. this.toolTipText.SetToolTip(this.chkEntry, "Quits after adding the entry, if checked");
  112. // 
  113. // label1
  114. // 
  115. this.label1.Location = new System.Drawing.Point(8, 8);
  116. this.label1.Name = "label1";
  117. this.label1.Size = new System.Drawing.Size(248, 14);
  118. this.label1.TabIndex = 2;
  119. this.label1.Text = "Type a filename here or click browse to select:";
  120. // 
  121. // label2
  122. // 
  123. this.label2.Location = new System.Drawing.Point(8, 8);
  124. this.label2.Name = "label2";
  125. this.label2.Size = new System.Drawing.Size(232, 14);
  126. this.label2.TabIndex = 1;
  127. this.label2.Text = "Type a folder name here:";
  128. // 
  129. // tpShare
  130. // 
  131. this.tpShare.Controls.AddRange(new System.Windows.Forms.Control[] {
  132.   this.btnBrowse,
  133.   this.label1,
  134.   this.txtFilename});
  135. this.tpShare.Location = new System.Drawing.Point(4, 25);
  136. this.tpShare.Name = "tpShare";
  137. this.tpShare.Size = new System.Drawing.Size(388, 89);
  138. this.tpShare.TabIndex = 0;
  139. this.tpShare.Text = "Share File";
  140. // 
  141. // btnBrowse
  142. // 
  143. this.btnBrowse.Location = new System.Drawing.Point(296, 56);
  144. this.btnBrowse.Name = "btnBrowse";
  145. this.btnBrowse.Size = new System.Drawing.Size(80, 24);
  146. this.btnBrowse.TabIndex = 1;
  147. this.btnBrowse.Text = "&Browse";
  148. this.btnBrowse.Click += new System.EventHandler(this.btnBrowseFile_Click);
  149. // 
  150. // txtFilename
  151. // 
  152. this.txtFilename.Location = new System.Drawing.Point(13, 26);
  153. this.txtFilename.Name = "txtFilename";
  154. this.txtFilename.Size = new System.Drawing.Size(363, 20);
  155. this.txtFilename.TabIndex = 0;
  156. this.txtFilename.Text = "";
  157. // 
  158. // tabShare
  159. // 
  160. this.tabShare.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
  161. this.tabShare.Controls.AddRange(new System.Windows.Forms.Control[] {
  162.    this.tpShare,
  163.    this.tpFolder});
  164. this.tabShare.Location = new System.Drawing.Point(16, 8);
  165. this.tabShare.Name = "tabShare";
  166. this.tabShare.SelectedIndex = 0;
  167. this.tabShare.Size = new System.Drawing.Size(396, 118);
  168. this.tabShare.TabIndex = 2;
  169. // 
  170. // tpFolder
  171. // 
  172. this.tpFolder.Controls.AddRange(new System.Windows.Forms.Control[] {
  173.    this.btnBrowseFileFolder,
  174.    this.label2,
  175.    this.txtFoldername});
  176. this.tpFolder.Location = new System.Drawing.Point(4, 25);
  177. this.tpFolder.Name = "tpFolder";
  178. this.tpFolder.Size = new System.Drawing.Size(388, 89);
  179. this.tpFolder.TabIndex = 1;
  180. this.tpFolder.Text = "Share Folder";
  181. // 
  182. // btnBrowseFileFolder
  183. // 
  184. this.btnBrowseFileFolder.Location = new System.Drawing.Point(296, 56);
  185. this.btnBrowseFileFolder.Name = "btnBrowseFileFolder";
  186. this.btnBrowseFileFolder.Size = new System.Drawing.Size(80, 24);
  187. this.btnBrowseFileFolder.TabIndex = 2;
  188. this.btnBrowseFileFolder.Text = "Browse";
  189. this.btnBrowseFileFolder.Click += new System.EventHandler(this.btnBrowseFolder_Click);
  190. // 
  191. // txtFoldername
  192. // 
  193. this.txtFoldername.Location = new System.Drawing.Point(13, 26);
  194. this.txtFoldername.Name = "txtFoldername";
  195. this.txtFoldername.Size = new System.Drawing.Size(363, 20);
  196. this.txtFoldername.TabIndex = 0;
  197. this.txtFoldername.Text = "";
  198. // 
  199. // btnOK
  200. // 
  201. this.btnOK.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(0)));
  202. this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
  203. this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold);
  204. this.btnOK.ForeColor = System.Drawing.Color.LemonChiffon;
  205. this.btnOK.Location = new System.Drawing.Point(240, 168);
  206. this.btnOK.Name = "btnOK";
  207. this.btnOK.Size = new System.Drawing.Size(85, 25);
  208. this.btnOK.TabIndex = 0;
  209. this.btnOK.Text = "&Share it";
  210. this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
  211. // 
  212. // lbCopyright
  213. // 
  214. this.lbCopyright.Location = new System.Drawing.Point(208, 8);
  215. this.lbCopyright.Name = "lbCopyright";
  216. this.lbCopyright.Size = new System.Drawing.Size(200, 12);
  217. this.lbCopyright.TabIndex = 5;
  218. this.lbCopyright.Text = "