摘要:
通过Button打开一个对话框,选择一个文件,在TextBox中显示文件的绝对路径private void btnOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { txtPath.Text = ofd.FileName; } }窗体中通过代码添加按钮的背景颜色pu... 阅读全文
摘要:
隐式转换,和显示转换 Checked (可能溢出时加上这个关键词)与uncheckedusing System;using System.Windows.Forms;class Conversions{ static void Main() { int a=5; long b; b=a;//隐式转换 Console.WriteLine(b); long c=5; int d; d=(int)c;//显示转换 Console.WriteLine(d); Co... 阅读全文
摘要:
集合:成功解决方案储备 阅读全文
摘要:
C# 系统配制技巧全集 阅读全文
摘要:
应用: TimeSpan ts =Convert.ToDateTime(serModel.EndDate).Subtract(Convert.ToDateTime(serModel.SatrtDate));serModel.ExecuteTrimLenght = Convert.ToInt32(ts.TotalSeconds);源码:1)(dt1 - dt2).TotalSecondsor dt1.Subtract(dt2).TotalSeconds2)要是想在C#中,就这么做, datatime d1=new datatime(2007,8,12,2,36,35); datatime... 阅读全文
摘要:
C#验证:限制TextBox只能输入数字并控制输入数字的长度 阅读全文
摘要:
TcpClient和TcpListener 类的使用-编写一个点对点聊天工具(初级入门篇) 阅读全文