摘要: 检查要打开的窗口是否已经是打开状态private void TestApplicationOpenFormsMethod() { #region 测试代码一 Form temp_form = new Form(); temp_form.Name = "MyForm"; foreach (Form f in Application.OpenForms) { if (f.Name == temp_form.Name) ... 阅读全文
posted @ 2011-11-16 17:34 心_远 阅读(222) 评论(0) 推荐(0) 编辑
摘要: bool isopen=false; foreach (Form childrenForm in this.MdiChildren) { if (childrenForm.Name=="fatherName")//这里对你来说应该是form2 { childrenForm.Visible = true;//如果你要求关闭的话就只要close就可以了,我现在是如果存在就显示,你可以参考一下,你也可以不 childrenFor... 阅读全文
posted @ 2011-11-16 17:03 心_远 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 在网络中搜索了下,发现使用接口来刷新父窗体,自己认为比较方便。也比较好容易理解。所以我也特此写一片博客进行记录,对自己进行深入的学习和方便再回头来复习。很多东西都是自己以前做过的,但是很长一段时间之后不代表就能很顺心的能写出来,所以我只能用博客文章记录我的点滴,下次翻阅的时候至少我会想起来在某个项目中使用到了这个情景。首先定义一个接口:using System;using System.Collections.Generic;using System.Text;namespace WinFormSendValue{ publicinterface IForm { v... 阅读全文
posted @ 2011-11-16 16:28 心_远 阅读(347) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Xml;using Zone;using System.Runtime.InteropServices;namespace 操作xml{ public partial class Form1 : Form { private int... 阅读全文
posted @ 2011-11-16 13:52 心_远 阅读(168) 评论(0) 推荐(0) 编辑
摘要: this.listView1.GridLines = true; //显示表格线 this.listView1.View = View.Details;//显示表格细节 this.listView1.LabelEdit = true; //是否可编辑,ListView只可编辑第一列。 this.listView1.Scrollable = true;//有滚动条 this.listView1.HeaderStyle = ColumnHeaderStyle.Clickable;//对表头进行设置... 阅读全文
posted @ 2011-11-16 09:03 心_远 阅读(8931) 评论(0) 推荐(0) 编辑
摘要: 已知有一个XML文件(bookstore.xml)如下:<?xml version="1.0" encoding="gb2312"?><bookstore> <book genre="fantasy" ISBN="2-3631-4"> <title>Oberon's Legacy</title> <author>Corets, Eva</author> <price>5.95</price> < 阅读全文
posted @ 2011-11-15 17:38 心_远 阅读(125) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2011-11-15 10:11 心_远 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 怎样终止无法正常终止的进程?ntsd 是一条dos命令,功能是用于结束一些常规下结束不了的死进程。用法为打开cmd 后输入以下命令就可以结束进程: 方法一:利用进程的PID结束进程 命令格式:ntsd -c q -p pid 命令范例: ntsd -c q -p 1332 (结束PID为1332的explorer.exe进程) 范例详解:explorer.exe的pid为1332,但是如何获取进程的pid呢?在CMD下输入TASKLIST就可以获取当前任务管理器所有进程的PID(并不是所有的exploer.exe进程都是1332) 方法二:利用进程名结束... 阅读全文
posted @ 2011-11-14 15:28 心_远 阅读(1220) 评论(0) 推荐(0) 编辑
摘要: 应该算是出于对各种DOCK的烦躁(部分DOCK程序在启动程序时,会把当前路径指派为DOCK所在路径,当程序中使用相对路径时,路径对“相对”到DOCK的文件夹里),我在程序中大多使用绝对路径来定位文件方便后来者,在这里总结了下,也摘抄了点网上流传的以我的程序为例物理路径:E:\c#学习\获取当前路径\获取当前路径\bin\Debug\获取当前路径.exeSystem.Environment.CurrentDirectory;//很熟悉了,获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。 //返回E:\c#学习\获取当前路径\获取当前路径\bin\Debug System.AppD.. 阅读全文
posted @ 2011-11-14 13:54 心_远 阅读(391) 评论(0) 推荐(0) 编辑
摘要: (1)仅在主键上建立聚集索引,并且不划分时间段:Select gid,fariqi,neibuyonghu,title from tgongwen 用时:128470毫秒(即:128秒) (2)在主键上建立聚集索引,在fariq上建立非聚集索引:select gid,fariqi,neibuyonghu,title from Tgongwenwhere fariqi> dateadd(day,-90,getdate()) 用时:53763毫秒(54秒) (3)将聚合索引建立在日期列(fariqi)上:select gid,fariqi,neibuyonghu,title from Tg. 阅读全文
posted @ 2011-11-11 09:59 心_远 阅读(136) 评论(0) 推荐(0) 编辑