net关闭某windos进程
System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses(); foreach (System.Diagnostics.Process myProcess in myProcesses) { if ("WINWORD" == myProcess.ProcessName.ToUpper()) { myProcess.Kill(); } }[@more@]
ASP.NET(C#)经典采集代码
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.Drawing;using MSXML2;using System.Text.RegularExpressions;namespace wenweifeng{ /**//// /// CaiJi 的摘要说明 /// public class CaiJi { public CaiJi() { // // TODO: 在此处添加构造函数逻辑 // } ~CaiJi() { Dispose(); } public void Dispose() { GC.SuppressFinalize
模拟dropdownlist控件控制下拉项的行数
<!--StartFragment--><%@ Page language="c#" Codebehind="WebDropDownList.aspx.cs"validateRequest="false" AutoEventWireup="false" Inherits="eMeng.WebDropDownList" %><HTML><HEAD><title>模拟下拉列表框</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style>BODY {FONT: 12px 宋体}TD {FONT: 12px 宋体}DIV {FONT: 12px 宋体}LABEL {PADDING-RIGHT: 0px; PADDING-LEFT:
在IE耗时操作中加入进度条或进度框
在IE耗时操作中加入进度条或进度框 加入进度条 this.Page.Response.Write("<div id='mydiv' >"); this.Page.Response.Write("_"); this.Page.Response.Write("</div>"); this.Page.Response.Write("<script>mydiv.innerText = '';</script>"); this.Page.Response.Write("<script language=javascript>;"); this.Page.Response.Write("var dots = 0;var dotmax = 10;function ShowWait()"); this.Page.Response.Write(&quo
ffmpeg.exe捕捉flv视频截图
下边是截图CatchImg方法,可从大多数的视频文件中截图成功,大家可测试;如果截图不成功,大多是因为视频本身的问题,如编码标准或加了密.但从在线录制的视频Flv文件中截图,还未发现截图失败;/// <summary>/// @从视频文件截图,生成在视频文件所在文件夹/// 在Web.Config 中需要两个前置配置项:/// 1.ffmpeg.exe文件的路径/// <add key="ffmpeg" value="E:ffmpegffmpeg.exe" />/// 2.截图的尺寸大小/// <add key="CatchFlvImgSize" value="240x180" />/// 3.视频处理程序ffmpeg.exe
UpdatePanel中文乱码问题解决
1. 在web.config里面增加<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN"/>2。编码using System.Collections.Specialized; string s = System.Text.Encoding.UTF8.GetString(Request.BinaryRead(Request.ContentLength)); NameValueCollection form = HttpUtility.ParseQueryString(s); string name = form[txtTitle.UniqueID];[@more@]
获取颜色值
<HTML> <HEAD> </HEAD> <body> <form name="WebForm1" method="post" id="WebForm2"> <INPUT type="button" value="选择颜色" name="b1" onclick="callColorDlg()"> </form> <SCRIPT> function callColorDlg() { var sColor = dlgHelper.ChooseColorDlg(); sColor = sColor.toString(16); if (sColor.length < 6)
获取IIS版本号
命名空间:System.DirectoryServices程序集:System.DirectoryServices(在 system.directoryservices.dll 中)private void Page_Load(object sender, System.EventArgs e){int loop1, loop2;NameValueCollection coll = Request.ServerVariables;String[] arr1 = coll.AllKeys; for (loop1 = 0; loop1 < arr1.Length; loop1++) {Response.Write("Key: " + arr1[loop1] + "<br/>");String[] arr2=coll.GetValues(arr1[loop1]);for (loop2 = 0; loop2 < arr2.Length; loop2++) {Response.Write("Value
安装membership数据库
安装membership数据库在使用SqlMembershipProvider以前需要安装一个membership数据库,使用一个SQL SERVER管理员权限登录到服务器,然后在Visual Studio 2005命令行模式下执行下面的语句 aspnet_regsql.exe -E -S localhost -A m看下几个参数:-E 表明此帐号使用windows集成认证-S 表明需要安装数据库的服务器名-A m 表明自动为membership建立相应的表和存储过程 注意:Aspnet_regsql 工具同样为其他ASP.NET 2.0特性安装数据库,比如说成员管理,Profile,个性化Web Parts还有Web Events等,当然都会有其他的命令,如果你不使用任何参数的
在 ASP.NET 2.0 中创建 Web 应用程序主题.NET技术
转载至:http://www.1shang.com/tech/tech14/techList66303.htm 个人bolg开发宝典:http://www.1shang.com/tech/tech14/[@more@]
.net日历控件添加天事件
using System; using System.Data; using System.Configuration; using System.Collections; 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 ALD.Ecommerce.Framework.Helper; public partial class Calendar_DateTest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Calendar1.DayRender += new DayRenderEventHandler(this.DayRender); } protected void