摘要:string strFilePaht="文件路径"; Path.GetFileNameWithoutExtension(strFilePath);这个就是获取文件名的还有的就是用Substring截取 strFilePaht.Substring(path.LastIndexOf("\\") + 1,...
阅读全文
摘要:1.建立一个WinForm工程,默认生成了一个WinForm窗体Form1。2.引用—>添加引用—>浏览—>weiFenLuo.winFormsUI.Docking.dll。3.设置Form1窗体属性IsMdiContainer:True。4.工具箱—>右键—>选择项—>.net组件—>浏览—>we...
阅读全文
摘要:http://www.cnblogs.com/content/archive/2013/05/31/3111156.html
阅读全文
摘要:IIS7以后application pool都支持两种模式:经典模式和集成模式。所谓经典模式就是与IIS6的application pool运行模式相同,对于asp.net的页面请求处理由单独的asp.net filter完成。集成模式是IIS7及以上的默认模式,对于各种请求的处理均在一条流水线上由...
阅读全文
摘要:泛型Action委托和Func委托是系统定义的两个泛型委托。 Action委托表示引用一个返回类型为Void的方法。这个委托存在不同的变体,可以传递之多16个不同的参数类型。同时,没有泛型参数的Action类可以调用没有参数的方法。例如,Action表示有一个输入参数的方法,Action表示有两个输...
阅读全文
摘要:这里是一个示例,其中展示了如何使用Backgroundworker对象在模态对话框中显示后台操作的实时进度条。 首先是主窗体代码:using System;using System.Collections.Generic;using System.ComponentModel;using Syst...
阅读全文
摘要:1,F2更换名字,自动完成 2.try switch等按两次TAB建,自动完成格式 3.自动属性快捷键 ctrl+r,ctrl+e 有人说是加个分号 就不需要写get set了。上下效果是相同的。 4.VS2013中,函数括号内直接按TAB跳出右面的括号下面网上收集,个人觉得折叠还有...
阅读全文
摘要:简介WatiN - Watir的.NET版:http://watin.sourceforge.net/Welcome at the WatiN(pronounced as What-in)website. InspiredbyWatirdevelopment of WatiN started in ...
阅读全文
摘要:在使用BackgroundWorker组件一文中,阐述了在Winform编程中,使用BackgroundWorker组件实现异步调用,本文主要讲述利用委托实现异步。以下描述摘抄于MSDN:异步委托提供以异步方式调用同步方法的能力。当同步调用委托时,Invoke()方法直接对当前线程调用目标方法;当异...
阅读全文
摘要:net(客户端)调用IIS(服务端)出现503后,就报操作超时错误问题描述:服务端环境:IIS客户端环境:windowsxp + iis + .net调用时出现如下错误:System.Net.WebException: 远程服务器返回错误: (503) 服务器不可用。 在 System.Net.Ht...
阅读全文
摘要:/// /// 一个到多个Cookie的字符串添加到CookieCollection集合中【isGood代码】 /// /// Cookie的字符串 /// 站点主机部分 public static CookieCollection strCokAddCol(string s, string defaultDomain) { CookieCollection cc = new CookieCollection(); if (string.IsNullOrEmpt...
阅读全文
摘要:今天 Shih-Min 问我说,假设网页一开始是AJAX 会载入一些资料,但是透过WebClient 去抓抓到都是JavaScript 跟 AJAX 的原始码,有办法可以抓到AJAX 取完值之后的资料吗?!这需求,如果写爬虫可能也会有这需求..我的作法是这样..我是ASP.net 专案..建立一个Class 记得要加入 System.Windows.Forms这时候我建立一只 Class 叫做 WebBrowserCrawlerusing System.Threading;using System.Windows.Forms; namespace GetAfterAJAXPage{ ...
阅读全文
摘要:先建一个"CookieContainer"把WebBrowser中的Cookie保存在里面//在WebBrowser中登录 cookie保存在 WebBrowser.Document.Cookie中CookieContainermyCookieContainer=newCookieContainer();//String的Cookie 要转成 Cookie型的 并放入CookieContainer中stringcookieStr=webBrowser1.Document.Cookie;string[]cookstr=cookieStr.Split(';');
阅读全文
摘要:WatiN —— Web Application Testing In .Net为什么会有WatiN?给用户提供一个.Net平台下,将Web测试自动化的便捷途径。如何通过WatiN来进行自动化测试的呢?摆事实,讲道理,乃严谨的科学态度,到底WatiN下的自动化测试如何便捷呢?代码[Test]publ...
阅读全文
摘要:public string GetContent(string str, string start, string last, int n) { if (str.ToLower().IndexOf(start.ToLower()) >= 0) { if (str.ToLower().IndexOf(last.ToLower()) >= 0) { switch (n) { ...
阅读全文
摘要:Json.NEThttp://json.codeplex.com/Json.Net是一个读写Json效率比较高的.Net框架.Json.Net 使得在.Net环境下使用Json更加简单。通过Linq To JSON可以快速的读写Json,通过JsonSerializer可以序列化你的.Net对象。让你轻松实现.Net中所有类型(对象,基本数据类型等)和Json的转换。Math.NEThttp://www.mathdotnet.com/Math.NET的目标是为提供一款自身包含清晰框架的符号运算和数学运算/科学运算,它是C#开发的开源类库。Math.NET含了一个支持线性代数的解析器,分析复杂微
阅读全文
摘要:CTRL+M 收缩格式化cs代码:Ctrl+k+f 格式化aspx代码:Ctrl+k+d5. 怎样快速切换不同的窗口?Ctrl+Tab7. 怎样快速添加代码段?输入prop然后按两次tab即可插入自动属性public int MyProperty { get; set; },(输入try,class,foreach等等,按两次tab也有类似效果。)1. 怎样调整代码排版的格式?选择:编辑—>高级—>设置文档的格式 或 编辑—>高级—>设置选中代码的格式。格式化cs代码:Ctrl+k+f 格式化aspx代码:Ctrl+k+d2. 怎样跳转到指定的某一行?两种方法:Ⅰ. C
阅读全文
摘要: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;using System.IO;using System.Text.RegularExpressions;namespace TESTIP{ public partial class Form1 : Form { publ...
阅读全文
摘要:方法一:public partial class WaterTextBox : TextBox { private readonly Label lblwaterText = new Label(); public WaterTextBox() { InitializeComponent(); lblwaterText.BorderStyle = BorderStyle.None; lblwaterText.Enabled = false; lblwaterText.Back...
阅读全文
摘要:写的一个XML操作类,包括读取/插入/修改/删除。using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Xml;namespace PuTianCheng{ /// ///.
阅读全文