随笔分类 - One V
Asp.net 开始
摘要:stringDepartment="Billing";DirectorySearcherLdapSearcher=newDirectorySearcher();LdapSearcher.PropertiesToLoad.Add("displayName");LdapSearcher.PropertiesToLoad.Add("cn");LdapSearcher.PropertiesToLoad.Add("department");LdapSearcher.PropertiesToLoad.Add("tit
阅读全文
摘要:Here's a quick tip to get started working with Excel interop in C#.// Create a new instance of the Excel applicationexcelFile = new Excel.ApplicationClass(); Excel.Workbook workbook = excelFile.Workbooks.Add(Type.Missing); // Now create a brand new workbookexcelFile.Visible = true; // ensure tha
阅读全文
摘要:以下方式若想改寫成抓取全部,想請教一些疑問撈出ActiveDirectory聯絡人按下button1撈出單個使用者:privatevoidbutton1_Click(objectsender,EventArgse){stringuid="GGYY";//Domain帳號stringpwd="12345";//密碼stringdomain=GetDomainName(domain_txt.Text);//取得DomainstringQueryString="LDAP://"+domain;DirectoryEntryldapConnec
阅读全文
摘要:BooleanIsBig5(stringstrOne){BooleanbIsBig5=false;byte[]ByteArrayBig5=System.Text.Encoding.GetEncoding("big5").GetBytes(strOne);if(ByteArrayBig5.Length==2){//checkA440~C67E常用字,C940~F9D5次常用字//42048~50814,51520~63957intiCode=ByteArrayBig5[0]*256+ByteArrayBig5[1];if((iCode>=42048&&i
阅读全文
摘要:<scriptlanguage="javascript"type="text/javascript">functionbtnClick(){varxmlhttp=newActiveXObject("Microsoft.XMLHTTP");//创建XMLHTTP对象if(!xmlhttp){alert("创建xml异常");returnfalse;}xmlhttp.open("POST","GetDateTime.ashx?ts"+newDate(),false);
阅读全文
摘要:usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.HtmlControls;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Xml.Linq;usingSystem.IO;usin.
阅读全文
摘要:http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c12235/ASPNET-Booking-Calendar-User-Control.htmBooking Calendar
阅读全文
摘要:SELECTCONVERT(VARCHAR,(DATEADD(week,1,getdate())-(DATEPART(DW,DATEADD(week,1,getdate())))),23)as下周一SELECTCONVERT(VARCHAR,(DATEADD(week,1,getdate())-(DATEPART(DW,DATEADD(week,1,getdate())))+1),23)SELECTCONVERT(VARCHAR,(DATEADD(week,1,getdate())-(DATEPART(DW,DATEADD(week,1,getdate())))+2),23)SELECTCON
阅读全文
摘要:DECLARE@REPORT_DATEDATETIME,@WEEK_BEGININGVARCHAR(10)SELECT@REPORT_DATE=getdate()SELECT@WEEK_BEGINING='MONDAY'IF@WEEK_BEGINING='MONDAY'SETDATEFIRST1ELSEIF@WEEK_BEGINING='TUESDAY'SETDATEFIRST2ELSEIF@WEEK_BEGINING='WEDNESDAY'SETDATEFIRST3ELSEIF@WEEK_BEGINING='THURSD
阅读全文
摘要:protectedvoidPage_Load(objectsender,EventArgse){SQLHelpersqH;if(!Page.IsPostBack){sqH=newSQLHelper();stringstrSelPro="SELECT[proName]FROM[db_city].[dbo].[tb_province]";DataTabledt=sqH.ExecuteQuery(strSelPro,CommandType.Text);if(dt.Rows.Count>0){DropDownList1.DataSource=dt;DropDownList1.
阅读全文
摘要:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title>无标题页</title><linkhref="css/mycss.css&qu
阅读全文
摘要:execmaster..xp_cmdshell'bcp"select*from[BookShop].[dbo].[tb_Books]where[UnitPrice]=22"queryoutd:temp.xls-c-q-S"."-U"sa"-P""'
阅读全文
摘要:1. 当前系统日期、时间select getdate()2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值例如:向日期加上2天select dateadd(day,2,'2004-10-15') --返回:2004-10-17 00:00:00.0003. datediff 返回跨两个指定日期的日期和时间边界数。select datediff(day,'2004-09-01','2004-09-18') --返回:174. datepart 返回代表指定日期的指定日期部分的整数。SELECT DATEPART(
阅读全文
摘要:-- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:修改新闻-- =============================================ALTER PROCEDURE [dbo].[news_UpdateByID] @newsName varchar(100), @classID int, @newsContent text, @newsID intASBEGINupd
阅读全文
摘要:selectage,count(*),max(age)as最大年龄fromperson1groupbyAgehavingAge>20selecttop3*fromperson1--筛选出年龄不在top3中的数据,也就是第四、五selecttop2*fromperson1whereagenotin(selecttop3agefromperson1orderbyagedesc)orderbyage--去掉数据重复selectDepartment,count(*)fromperson1groupbyDepartmentselectdistinctDepartment,Agefromperson
阅读全文
摘要:ALTER TRIGGER [dbo].[trigCateDelete] ON [dbo].[category] instead of DELETEAS BEGIN declare @caId int select @caId=(select id from deleted) delete comment where newsId in (select newsId from news where caId=@caId) delete news where caId=@caId delete category where id=@caIdENDALTER procedure [dbo].[p.
阅读全文
摘要:WindowprotectedvoidMess(stringMes){this.ClientScript.RegisterStartupScript(GetType(),"a","alert('"+Mes+"');",true);}VS向SQL中寫入DateTime:SqlParameter[]sqlParaInsert=newSqlParameter[]{newSqlParameter("@empNo",txt_Employee_No.Text.Trim()),newSqlParameter(&q
阅读全文
摘要:Google:http://community.arubanetworks.com/t5/ArubaOS-and-Controllers/MAC-Address-Authentication-Server-Group/td-p/8808/page/2http://www.google.com.hk/#q=aruba+guest+mac+address&hl=zh-CN&newwindow=1&safe=strict&prmd=imvns&ei=rk3DT7vDKKjeigeBwK2wCg&start=10&sa=N&fp=1&am
阅读全文
摘要:验证码类:usingSystem.Drawing;publicpartialclassvalidateNum:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){stringvalidateNum=CreateRandomNum(4);//成生位随机字符串CreateImage(validateNum);//将生成的随机字符串绘成图片Session["ValidateNum"]=validateNum;//保存验证码}}//生成随机字符串privatestrin
阅读全文
摘要:SQLHelper类执行对数据库的访问,并返回值:连接DB的方法以及SqlCommand的各种方法的重写(传入参数,参数类型,返回的值)等。App_Code文件夹存放网站中通用的类,App_Data文件夹存放一些数据文件XML文件等,WebConfig文件中存放全局的参数。缓存可以提高对DB的访问效率,.CS文件更改后需要编译重新生成。try,catch中可以把错误日志写到Log中。usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Sec
阅读全文

浙公网安备 33010602011771号