摘要: DirectoryInfo TheFolder=new DirectoryInfo(folderFullName);//遍历文件夹foreach(DirectoryInfo NextFolder in TheFolder.GetDirectories()) this.listBox1.Items.Add(NextFolder.Name);//遍历文件foreach(FileInfo NextFile in TheFolder.GetFiles()) this.listBox2.Items.Add(NextFile.Name);================================== 阅读全文
posted @ 2011-09-15 14:34 张@天 阅读(254) 评论(0) 推荐(0) 编辑
摘要: <script language='javascript' type='text/javascript'> var secs = 10; //倒计时的秒数 var URL; function Load(url) { URL = url; for (var i = secs; i >= 0; i--) { window.setTimeout('doUpdate(' + i + ')', (secs - i) * 1000); } ... 阅读全文
posted @ 2011-09-09 11:55 张@天 阅读(756) 评论(0) 推荐(0) 编辑
摘要: 在操作EXCEL时,看到一个方法是杀掉所有“EXCEL”进程,这样如果有打开的文档也会被关且不提示是否保存,使用者会疯掉的,下面这种方法可以只杀当前进程Microsoft.Office.Interop.Excel.Applicationm_xlApp=newMicrosoft.Office.Interop.Excel.Application();intm_k=m_xlApp.Hwnd;//进行操作KillProcess(m_k);//关闭进程//关闭的方法[DllImport("User32.dll",CharSet=CharSet.Auto)]publicstaticex 阅读全文
posted @ 2011-09-09 09:33 张@天 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1.最常用的页面跳转(原窗口被替代):Response.Redirect("XXX.aspx");2.利用url地址打开本地网页或互联网:Respose.Write("<script language='javascript'>window.open('"+ url+"');</script>");3.原窗口保留再新打开另一个页面(浏览器可能阻止,需要解除):Response.Write("<script>window.open('XXX.aspx& 阅读全文
posted @ 2011-09-05 11:01 张@天 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 命名空间:using System.Runtime.InteropServices;public class Win32 { public const Int32 AW_HOR_POSITIVE = 0x00000001; public const Int32 AW_HOR_NEGATIVE = 0x00000002; public const Int32 AW_VER_POSITIVE = 0x00000004; public const Int32 AW_VER_NEGATIVE = 0x00000008; public const Int32 AW_CENTER = 0x00000010 阅读全文
posted @ 2011-09-02 14:41 张@天 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 方法一:用正则表达式的方法//引用的命名空间using System.Text.RegularExpressions;public bool isExists(string str) { return Regex.Matches(str, "[a-zA-Z]").Count > 0; }方法二:#region 判断字符串是否有字母 /// <summary> /// 名称:IsAllChar /// 判断文本是否全是字母组合 /// </summary> /// <param name="text">需判断的文本 阅读全文
posted @ 2011-09-02 11:36 张@天 阅读(9239) 评论(0) 推荐(0) 编辑
摘要: Len Len(string|varname) 返回字符串内字符的数目,或是存储一变量所需的字节数。 Trim Trim(string) 将字符串前后的空格去掉 Ltrim Ltrim(string) 将字符串前面的空格去掉 Rtrim Rtrim(string) 将字符串后面的空格去掉 Mid Mid(string,start,length) 从string字符串的start字符开始取得length长度的字符串,如果省略第三个参数表示从start字符开始到字符串结尾的字符串 Left Left(string,length) 从string字符串的左边取得length长度的... 阅读全文
posted @ 2011-09-02 11:33 张@天 阅读(2967) 评论(0) 推荐(1) 编辑
摘要: <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <!--换行开始--> <%# ((Container.ItemIndex+1) %3 == 0 )? "<br />" :""%> <!--换行结束--> </ItemTemplate> </asp:Repeater> 阅读全文
posted @ 2011-07-13 11:19 张@天 阅读(182) 评论(0) 推荐(0) 编辑
摘要: string str = ""; string str2 = ""; string[] arr2 = { "预约时间", "姓名", "性别", "年龄", "电话", "身份证号码", "诊疗卡号", "订单号", "挂号时间", "科室", "医院", "监护人" }; string[] arr1 = { &quo 阅读全文
posted @ 2011-07-01 10:00 张@天 阅读(1333) 评论(0) 推荐(0) 编辑
摘要: truncate table tablename 清空表数据1.增加字段 alter table docdsp add dspcodechar(200)2.删除字段 ALTER TABLE table_NAME DROP COLUMNcolumn_NAME3.修改字段类型 ALTER TABLE table_name ALTER COLUMNcolumn_name new_data_type4.sp_rename 改名EXEC sp_rename '[dbo].[Table_1].[filedName1]', 'filedName2', 'COLUMN& 阅读全文
posted @ 2011-06-14 10:57 张@天 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 今天在51aspx上发现了一款菜单生成器,感觉还不错;可是下载下来一看全是英文的,后来就去百度上找,终于被我找到了中文版的。在这给大家看看http://files.cnblogs.com/ZSCFang/菜单生成器.rar 阅读全文
posted @ 2011-06-01 14:41 张@天 阅读(345) 评论(0) 推荐(0) 编辑
摘要: Asp.net中一次性清空页面上的所有TextBox中的内容,由于TextBox在客户端以<input type=”text”>形式来呈现的,因此解决方案有客户端和服务器端两种方式,服务器端包括两种方法!这个破东西在asp.net面试题中广为流传(我感受颇深).方法一:Code1foreach (Control c in this.FindControl("form1").Controls)2{3 if (c is TextBox)4 {5 ((TextBox)c).Text = "";6 }7}8910方法二:Code1 FieldInfo 阅读全文
posted @ 2011-05-31 18:04 张@天 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 检索 COM 类工厂中 CLSID 为 {91493441-5A91-11CF-8700-00AA0060263B} 的组件时失败,原因是出现以下错误: 80070005 在CSDN上总是有网友问这个问题,自己也遇到过,因些写出来供参考:症状:oWordApplic = New Word.Application当程序运行到这句时出现下面的错误:检索 COM 类工厂中 CLSID 为 {91493441-5A91-11CF-8700-00AA0060263B} 的组件时失败,原因是出现以下错误: 80070005。oWordApplic = New Word.Application当程序运行到这 阅读全文
posted @ 2011-05-25 15:33 张@天 阅读(2617) 评论(4) 推荐(1) 编辑
摘要: if(strSelectedItemName=="True"){this.timer1.Enabled=true;this.timer1.Start();return;}else{this.timer1.Stop();//停止计时}3种Timer的用法(转) 关于C#中timer类在C#里关于定时器类就有3个1.定义在System.Windows.Forms里2.定义在System.Threading.Timer类里"3.定义在System.Timers.Timer类里System.Windows.Forms.Timer是应用于WinForm中的,它是通过Wind 阅读全文
posted @ 2011-05-25 11:09 张@天 阅读(4563) 评论(0) 推荐(1) 编辑
摘要: 导出将数据库(test)完全导出,用户名sys 密码manager 导出到D:\daochu.dmp中 exp sys/manager@test file=d:\daochu.dmp full=y导入将D:\daochu.dmp 中的数据导入 test数据库中。 imp sys/manager@test file=d:\daochu.dmp 阅读全文
posted @ 2011-05-24 14:19 张@天 阅读(1007) 评论(0) 推荐(1) 编辑