程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 更多關於編程 >> Linux零碎上Samba服務器的配置教程

Linux零碎上Samba服務器的配置教程

編輯:更多關於編程

Linux零碎上Samba服務器的配置教程。本站提示廣大學習愛好者:(Linux零碎上Samba服務器的配置教程)文章只能為提供參考,不一定能成為您想要的結果。以下是Linux零碎上Samba服務器的配置教程正文


本文實例講述了C#完成兩個窗體之間數值傳送的辦法。分享給大家供大家參考,詳細如下:

以下是自己常用的辦法,其實辦法很多,但我覺得這兩種我比擬好了解,要是哪位冤家有比擬復雜的易懂的其他辦法,希望不吝賜教。

辦法一:

比方要在FORM2裡失掉FORM1裡的值,先在FORM1裡定義一個私有的字符串

public string transsformValue
{
 get
   {
    return this.textBox1.Text;
   }
 set
   {
    this.textBox1.Text=value; 
  }
}

在FORM1裡這麼寫(在外面也加一個TEXTBOX):.

FORM2 f=new FORM2();
f.transsformValue="aaaa";
textBox1=f.transsformValue;
f.Show();

這樣運轉後是將FORM2的文本框的值設為“aaaa”,並且顯示在FORM1裡的文本框裡

實例演示

FORM1裡這麼寫:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication17
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
    }
    private void button1_Click(object sender, EventArgs e)
    {
      InputBox f = new InputBox();
      f.Title = "請輸出對話框";
      f.TipText = "請輸出年齡";
      if (f.ShowDialog() == DialogResult.OK)
        this.label1.Text = f.Message;
    }
  }
}
//InputBox的FORMl裡這麼寫
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication17
{
  public partial class InputBox : Form
  {
    public InputBox()
    {
      InitializeComponent();
    }
    public string Title
    {
      set { this.Text = value; }
    }
    public string Message
    {
      get { return this.Input.Text; }
    }
    public string TipText
    {
      set { this.Tip.Text = value; }
    }
    private void InputBox_Load(object sender, EventArgs e)
    {
      this.AcceptButton = this.btnOK;
      this.CancelButton = this.btnCancel;
      this.btnOK.DialogResult = DialogResult.OK;
      this.btnCancel.DialogResult = DialogResult.Cancel;
    }
  }
}

運轉效果截圖如下:

希望本文所述對大家C#順序設計有所協助。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved