随笔分类 -  C#

摘要:一:本篇将解决的问题本章主要为了解决一下几个问题:1.JsDialog的按钮错位的问题 我们开发出的浏览器,在有些操系统上调用alert,confirm之类的对话框时,确定和取消按钮会出现错位的情况2.右键菜单问题 我们开发的浏览器,在网页上点右键,会出现一些讨厌的英文菜单。3.打印的问题 我们开发的浏览器,网页在调用window.print的时候,没有任何反应。4.打开chrome的调试器 谷歌浏览器调试网页的调试器非常好用,我们开发的浏览器也可以用这个工具。二:JsDialog的按钮错位的问题先在BS文件夹中新建一个类,取名为JsDialogHandler,让这个类继承自CefJS... 阅读全文
posted @ 2013-06-19 16:49 liulun 阅读(23943) 评论(47) 推荐(10) 编辑
摘要:一、泛型入门:我们先来看一个最为常见的泛型类型List<T>的定义(真正的定义比这个要复杂的多,我这里删掉了很多东西)[Serializable]public class List<T> : IList<T>, ICollection<T>, IEnumerable<T>{ public T this[int index] { get; set; } public void Add(T item); public void Clear(); public bool Contains(T item); public int IndexO 阅读全文
posted @ 2013-05-02 08:01 liulun 阅读(18601) 评论(58) 推荐(69) 编辑
摘要:说明: 这是本系列的第一篇文章,我会尽快发后续的文章。源起 1.加快葬送IE6浏览器的进程 世界上使用IE6浏览器最多的地方在中国 中国使用IE6浏览器最多的地方在企业中 让他们自己去装个chorme太难了 索性开发个浏览器(其实是浏览器的外壳)给他们 用"代码改变世界"是博客园园友的口号 2.一劳永逸的解决浏览器兼容问题 各种浏览器的CSS hack问题再也不用担心了 甚至公司里前端的职位也可以减少几个了 3.更方便的使用更强大的HTML5 写HTML5的样式,需要考虑各种的浏览器独有的东西, 比如:-webkit-trans... 阅读全文
posted @ 2013-03-18 11:10 liulun 阅读(44418) 评论(85) 推荐(28) 编辑
摘要:千万别被这个页面的滚动条吓到!!! 我相信你一定能在30分钟之内看完它!!! 在说LINQ之前必须先说说几个重要的C#语言特性 一:与LINQ有关的语言特性 1.隐式类型 (1)源起 在隐式类型出现之前, 我们在声明一个变量的时候, 总是要为一个变量指定他的类型 甚至在foreach一个集合的时候, 阅读全文
posted @ 2013-02-26 19:10 liulun 阅读(236475) 评论(331) 推荐(334) 编辑
摘要:static string GetHtml(string url) { HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Timeout = 16 * 1000; HttpWebResponse response = request.GetResponse() as HttpWebResponse; Stream stream = response.GetResponse... 阅读全文
posted @ 2012-12-27 22:04 liulun 阅读(1582) 评论(5) 推荐(0) 编辑
摘要:开发者预览版.net 4.5.NET for Metro style appsMetro风格的应用程序是利用Windows操作系统的强大功能设计的特殊表单元素。一个称之为.NET APIs for Metro style apps的.Net的一个子集用来支持Metro风格的应用程序,可以使用C#或Visual Basic来编写Metro风格的应用程序。详见:http://go.microsoft.com/fwlink/?LinkId=228491核心新功能和改进以下这些功能和改进被添加到公共语言运行时(CLR)和.NET的类内:-设置正则表达式执行匹配的超时时间-为应用程序域设置区域性信息-控 阅读全文
posted @ 2012-01-09 13:54 liulun 阅读(10656) 评论(33) 推荐(8) 编辑
摘要:Template文件<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #><#@ assembly name="Microsoft.SqlServer.Smo" #><#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #><#@ import namespace="System" #><#@ import namespace=" 阅读全文
posted @ 2011-12-14 21:12 liulun 阅读(1120) 评论(0) 推荐(1) 编辑
摘要:using System;using System.Security.Cryptography; using System.Text;namespace Maticsoft.DBUtility{ /// <summary> /// DES加密/解密类。 /// </summary> public class DESEncrypt { public DESEncrypt() { } #region ========加密======== /// <summary> /// 加密 /// </summary> /// <pa... 阅读全文
posted @ 2011-11-26 18:32 liulun 阅读(438) 评论(0) 推荐(0) 编辑
摘要:客户端代码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.ServiceProcess;using System.Text;using System.Threading;using System.Management;using System.Configuration;using System.Net;using System.IO;namespace MON.WS{ publ... 阅读全文
posted @ 2011-11-12 15:15 liulun 阅读(1412) 评论(0) 推荐(2) 编辑
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Threading;using System.Xml;using System.IO;using System.IO.Compression;using System.Resources;using System.Net;using System.Web.S 阅读全文
posted @ 2011-11-12 15:04 liulun 阅读(1269) 评论(1) 推荐(3) 编辑
摘要:using system;using system.runtime.interopservices;namespace myserviceinstaller{ class serviceinstaller { #region private variables private string _servicepath; private string _servicename; private string _servicedisplayname; #endregion private variables ... 阅读全文
posted @ 2011-10-25 14:24 liulun 阅读(642) 评论(1) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Text;using System.Diagnostics;using System.Threading;using System.Management;using System.Runtime.InteropServices;using System.Data;using System.Data.SqlClient;using System.DirectoryServices;using System.Collections;using System.Configuratio 阅读全文
posted @ 2011-10-25 10:18 liulun 阅读(791) 评论(0) 推荐(1) 编辑
摘要:程序说明:针对杭州市机动车驾驶员模拟培训预约难的问题,本人开发了此监视工具。此监视工具仅负责监视某段时间内在线预约网站是否可以预约模拟培训。只是提示用户某日可以预约,不会帮助用户进行预约,更不会收集用户的身份信息。使用说明: 使用前请先确认电脑可以访问互联网 使用前请先联系作者激活程序!作者QQ 4-1-2-5-8-8-8-0-11.选择监视截止日期(程序将监视当前时间与此日期之间的时间段)2.选择“阶段一”,“阶段二”(即你要预约那个阶段的模拟培训)3.点击开始监视,系统将执行监视。4.点击退出,系统将停止监视,并退出5.点击最小化到托盘,系统将继续监视并最小化到托盘。 如果在此时间段内,有 阅读全文
posted @ 2011-09-07 08:40 liulun 阅读(2186) 评论(2) 推荐(3) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.Office.Interop.Excel;using System.Reflection;namespace ListToExcel{ class Program { static List<objtype> objs = new List<objtype>(); static void Main(string[] args) { objs.Add(new objtype() 阅读全文
posted @ 2011-04-22 09:16 liulun 阅读(1100) 评论(0) 推荐(0) 编辑
摘要:DEMO的下载地址:http://files.cnblogs.com/liulun/flashUploader.rar参考文章所在地址:http://blog.l4cd.net/post-old-102.htmlhttp://www.kingnare.com/auzn/archives/548本来想做SL版的断点续传,但是客户觉得SL客户端占有率太低就选择采用FLASH版的了FLASH AS3.0... 阅读全文
posted @ 2010-06-16 15:15 liulun 阅读(2499) 评论(0) 推荐(0) 编辑
摘要:1:这个做法不太常用2:这个方法要传递两个参数,打算用扩展方法解决这个问题,但是扩展方法又不能用在匿名类型上,有点郁闷using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication8{ class Program { static void Main(string[] args) { Func<string, string, string> getAllName = deleg... 阅读全文
posted @ 2010-03-19 09:06 liulun 阅读(474) 评论(1) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.IO;using System.Text.RegularExpressions;namespace allen{ class Program { /// <summary> /// 根据网址取得HTML代码 /// </summary> /// <param name="url"></param> ... 阅读全文
posted @ 2010-03-06 14:31 liulun 阅读(1192) 评论(5) 推荐(2) 编辑
摘要:using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;using System.Reflection;namespace ConsoleApplication6{ /// <summary> /// AttributeTargets.Clas... 阅读全文
posted @ 2010-02-25 11:50 liulun 阅读(1714) 评论(2) 推荐(3) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int? a; a = null;//此时输出3 //a = 6;//此时... 阅读全文
posted @ 2010-02-19 19:59 liulun 阅读(2070) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-- using System.Runtime.Serialization.Formatters.Binary; using System.IO; using (Stream s = (Stream)(... 阅读全文
posted @ 2009-12-23 12:49 liulun 阅读(450) 评论(0) 推荐(0) 编辑