随笔分类 -  C# Winform

1
摘要:1、event Action<string> 实现FormA打开FormB,FormB的值 回传到FormA上 FormA的代码: private void button1_Click(object sender, EventArgs e) { FrmB frm = new FrmB(); frm. 阅读全文
posted @ 2021-08-31 16:51 一叶孤城 阅读(1075) 评论(1) 推荐(0)
摘要:修改 .sln文件里的划线部分,按照要降的版本进行修改,然后用对应版本的开发工具 打开 即可 阅读全文
posted @ 2021-04-02 16:16 一叶孤城 阅读(300) 评论(0) 推荐(0)
摘要:textBox3.Text.Split(new string[] { "\r\n" }, StringSplitOptions.None) 阅读全文
posted @ 2020-09-29 14:13 一叶孤城 阅读(1759) 评论(0) 推荐(0)
摘要:服务方法 1 [HttpGet] 2 public string GetWebName(string name,string pwd) 3 { 4 Dictionary<string, string> dict = new Dictionary<string, string>(); 5 dict.A 阅读全文
posted @ 2020-03-30 22:44 一叶孤城 阅读(914) 评论(0) 推荐(0)
摘要:服务方法 1 [AllowAnonymousAttribute] 2 [HttpPost] 3 public string PostWebName(dynamic login) 4 { 5 Dictionary<string, string> dict = new Dictionary<string 阅读全文
posted @ 2020-03-30 22:18 一叶孤城 阅读(1252) 评论(0) 推荐(0)
摘要:第一步、WebServices提供的方法没有变动(需要可查看我的上一篇 Http POST方式) 第二步、为了让WebServices支持GET方式,则需要在Web.config配置文件中增加如下代码 1 <system.web> 2 <webServices> 3 <protocols> 4 <a 阅读全文
posted @ 2020-03-26 22:23 一叶孤城 阅读(892) 评论(0) 推荐(0)
摘要:第一步、编写WebServices服务方法 1 [WebMethod] 2 public void PostJson(string str, string bb) 3 { 4 Dictionary<string, object> DictResult = new Dictionary<string, 阅读全文
posted @ 2020-03-26 21:53 一叶孤城 阅读(1129) 评论(0) 推荐(0)
摘要:第一步、Winform项目引用WEB服务 第二步、代码声明实例化 Web引用 YzServ.TestServ yzserv = new WebYzServ.TestServ(); yzserv.AAA("参数值"); 阅读全文
posted @ 2020-03-26 20:40 一叶孤城 阅读(434) 评论(0) 推荐(0)
摘要:private void dgvBig_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) {if (dgvBig.Columns["IsBigWeight"]==null)return; if (dgvBig.C 阅读全文
posted @ 2019-09-06 18:10 一叶孤城 阅读(1779) 评论(0) 推荐(1)
摘要:安装SQL Server 2008 R2报错“此计算机上安装了 Microsoft Visual Studio 2008 的早期版本,请在安装 SQL Server 2008 前将 VS2008 升级到 SP1“。 解决方法: 32位操作系统: 打开注册表,将 HKEY_LOCAL_MACHINE/ 阅读全文
posted @ 2019-09-06 08:29 一叶孤城 阅读(1952) 评论(0) 推荐(0)
摘要:JavaScriptSerializer jss = new JavaScriptSerializer(); Dictionary dict = new Dictionary(); string strDATAJSON = ""; dict.Add("AA", "00"); dict.Add("BB", "00")... 阅读全文
posted @ 2019-08-03 10:42 一叶孤城 阅读(9155) 评论(0) 推荐(0)
摘要:一、获取JSon中某个项的值 要解析格式: [{"VBELN":"10","POSNR":"10","RET_TYPE":"S","RET_MSG":"写入失败:"},{"VBELN":"00","POSNR":"00","RET_TYPE":"E","RET_MSG":"写入失败:&qu 阅读全文
posted @ 2019-08-03 10:38 一叶孤城 阅读(13359) 评论(0) 推荐(0)
摘要:1、调出 TreeView控件 或 ListBox控件 private void deductGrid1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) 阅读全文
posted @ 2019-07-12 17:32 一叶孤城 阅读(800) 评论(0) 推荐(0)
摘要://通过访问目录下的DLL Assembly ass = Assembly.LoadFile(Application.StartupPath + "\\Design.dll"); Type tp = ass.GetType("Design.Form1",false); Form frm = (For 阅读全文
posted @ 2019-07-12 16:49 一叶孤城 阅读(890) 评论(0) 推荐(0)
摘要:1、控件效果图 此效果图中的标题颜色、字号及字体可以在控件属性中设置。标题背景的渐变色及布局内容的背景色也可以在属性中设置。 2、实现的代码(用户控件) 1 public partial class UcPanel : UserControl 2 { 3 public UcPanel() 4 { 5 阅读全文
posted @ 2019-07-12 10:52 一叶孤城 阅读(918) 评论(0) 推荐(0)
摘要:Linq生成XML的方法: string CreateXML(string strkey, string strDATAJSON) { XDeclaration dec = new XDeclaration("1.0", "UTF-8", null); XDocument xdoc = new XD 阅读全文
posted @ 2019-07-10 14:28 一叶孤城 阅读(357) 评论(0) 推荐(0)
摘要:针对上面格式的XML字符串,获取出来 数组内容或关键标示 解析代码: try { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(strxml);//Load加载XML文件,LoadXML加载XML字符串 XmlElement root 阅读全文
posted @ 2019-07-10 11:34 一叶孤城 阅读(4703) 评论(0) 推荐(0)
摘要:1、发送方代码 2、接收方代码 3、UdpService代码 阅读全文
posted @ 2019-05-15 12:59 一叶孤城 阅读(10903) 评论(0) 推荐(0)
摘要:最近做了一个 自动升级程序 在 下载文件和 解压缩文件时 用到了 进度条 今天先把 进度条的使用 记录下 改天有时间 把自动升级 程序 再记录进来进度条 读取 离不开 线程现在用两种方法实现这个效果一、用VS 里自带的Timer控件 int A =1; private void timer1_Tic... 阅读全文
posted @ 2015-01-09 19:54 一叶孤城 阅读(2088) 评论(0) 推荐(0)
摘要:/// /// 数据备份 /// /// public bool DataBackup(string getpath) { try { SqlConnection con = new SqlConnection();//利用代码实现连接数据库 con.ConnectionString = Co... 阅读全文
posted @ 2014-12-12 10:01 一叶孤城 阅读(1951) 评论(0) 推荐(0)

1