C#窗体中输入的数据提取
来源:互联网 发布:淘宝全屏海报轮播滚动 编辑:程序博客网 时间:2024/04/29 08:09
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 WindowsFormsApplication1
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime dt = new DateTime();//获取当前系统时间
time.Text = DateTime.Now.ToString() ;
}
private void btnRegist_Click(object sender, EventArgs e)
{
//获取输入的数据
string name = tbxName.Text;
string pwd = tbxPwd.Text;
string sex;
string birth = dateTimePicker1.Value.ToString();
string hobby = ""; ;
string zhiwei = comboBox1.SelectedItem.ToString();
string qianming = richTextBox1.Text;
if (rbtnM.Checked)
{
sex = rbtnM.Text;
}
else
{
sex = rbtnM.Text;
}
if (checkBox1.Checked)
{
hobby += checkBox1.Text;
}
if (checkBox2.Checked)
{
hobby+=checkBox2.Text;
}
if (checkBox3.Checked)
{
hobby += checkBox3.Text;
}
if (checkBox4.Checked)
{
hobby += checkBox4.Text;
}
string all = string.Format("{0}{1}{2}{3}{4}{5}{6}", name, pwd, sex, birth, hobby, zhiwei, qianming);
MessageBox.Show(all);
}
private void Form6_Load(object sender, EventArgs e)
{
time.Text = DateTime.Now.ToString();
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime dt = new DateTime();//获取当前系统时间
time.Text = DateTime.Now.ToString() ;
}
private void btnRegist_Click(object sender, EventArgs e)
{
//获取输入的数据
string name = tbxName.Text;
string pwd = tbxPwd.Text;
string sex;
string birth = dateTimePicker1.Value.ToString();
string hobby = ""; ;
string zhiwei = comboBox1.SelectedItem.ToString();
string qianming = richTextBox1.Text;
if (rbtnM.Checked)
{
sex = rbtnM.Text;
}
else
{
sex = rbtnM.Text;
}
if (checkBox1.Checked)
{
hobby += checkBox1.Text;
}
if (checkBox2.Checked)
{
hobby+=checkBox2.Text;
}
if (checkBox3.Checked)
{
hobby += checkBox3.Text;
}
if (checkBox4.Checked)
{
hobby += checkBox4.Text;
}
string all = string.Format("{0}{1}{2}{3}{4}{5}{6}", name, pwd, sex, birth, hobby, zhiwei, qianming);
MessageBox.Show(all);
}
private void Form6_Load(object sender, EventArgs e)
{
time.Text = DateTime.Now.ToString();
}
}
}
设计页面:
- C#窗体中输入的数据提取
- C#中窗体之间的数据传递
- C#中窗体之间的数据传递
- Java中提取输入字符串中数据的个人经验
- C#中窗体间传递数据的几种方法
- C#中窗体间传递数据的几种方法
- C#中窗体间传递数据的几种方法
- C#中窗体间数据传递的两种方法
- C#中窗体间传递数据的几种方法
- C#中不同窗体之间的数据传递
- C#中窗体间传递数据的几种方法
- C#之winform基础 ,form1显示form2中textbox中输入的文本,窗体间传值
- C#中一个窗体怎样对另外一个窗体操作,使窗体上的数据得到刷新?
- c# 中窗体的位置
- 处理在 Windows 窗体 DataGridView 控件中输入数据时发生的错误
- 使用字符串输入流从字符串中提取数据
- C#不同窗体之间的数据传递
- c#中怎样在窗体间相互传送数据,且能在修改窗体A的数据时,窗体B能够根据窗体A的数据同时作出反应修改其相应数据
- 如何打开UPnP功能
- oracle导入dmp数据文件
- LinkedIn创始人Reid Hoffman写给毕业生的3个通往成功的秘密
- JVM加载class文件的原理机制
- Oracle 视图(View)
- C#窗体中输入的数据提取
- Qt C++ visitor模式
- Android-Universal-Image-Loader应用详解
- java学习心得
- DSS RTSPSession::Run State Transfer (2)
- 史玉柱自述营销心得:降价就是自杀
- [5月23日的脚本] 列出Windows 8中的激活状态 (VBScript)
- 0044算法笔记——【随机化算法】舍伍德(Sherwood)算法和线性时间选择问题
- SQL中CONVERT()转化函数的用法 字符串转日期