文章分类 -  C# Winform

上一页 1 2 3 4 5 6 下一页
C# Winform
C# WebRequest发起Http Post请求模拟登陆并cookie处理示例
摘要:CookieContainer cc=new CookieContainer();string url = “http://mailbeta.263.net/xmweb”;HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);request.Method = “POST”;request.ContentType = “application/x-www-form-urlencoded”;request.CookieContainer=cc;string user=”user”; //用户名string pass=”pas 阅读全文
posted @ 2011-06-11 11:06 西湖浪子 阅读(696) 评论(0) 推荐(0)
GridView添加统计行.net
摘要:前提:设置属性ShowFooter="True"方法一:使用SQL查询统计出合计值,在绑定GridView时让其结果赋于一个DataTable(全局变量),然后在RowDataBound事件中程序代码:if (e.Row.RowType == DataControlRowType.Footer){e.Row.Cells[0].Text = "合计";e.Row.Cells[3].Text = dtSum.Rows[0][0].ToString();e.Row.Cells[4].Text = dtSum.Rows[0][1].ToString();e.Ro 阅读全文
posted @ 2011-06-08 10:43 西湖浪子 阅读(186) 评论(0) 推荐(0)
分享一些我在开发过程中用过的资源 (转)
摘要:以下所提到的控件/组件均为开源或免费的。1,ComboBox控件: Upgrade Your Select Element to a ComboBox2,DateTimePicker控件: GrayMetterSoft3,TabStrip控件: A simple ASP.NET Web TabStrip User Control4,Grid控件: XGrid5,数据结构Tree: A Generic Tree Collection6,csv文件<->DataTable: CSV file parser and writer in C#7,邮件发送: DotNetOpenMail8, 阅读全文
posted @ 2011-05-14 00:23 西湖浪子 阅读(217) 评论(0) 推荐(0)
C# Mail POP
摘要:最近在郵件發送失敗率的統計,要從GMail中抓取郵件發送失敗信息;在網上找了一段C#代碼就是抓不到數據using System;using System.Net.Sockets;using System.Net;using System.Security.Cryptography;using System.IO;using System.Data;namespace GetMail{ /// <summary> /// 获取邮件(的)类 /// zgke@sina.com /// qq:116149 /// </summary> public class POP3 { 阅读全文
posted @ 2011-05-14 00:02 西湖浪子 阅读(380) 评论(0) 推荐(0)
c#实现动态创建二级域名,比如当用户注册成功后就会给他一个网址http://name.site.com,博客网站上都有这种功能.
摘要:第一步:把域名设置成泛解析. 就是把*.域名 解析到你的主机,是否支持泛解析,请查看你的域名商说明. 第二步:IIS设成的时候不要绑定域名.注意一台服务器里只能有一个站点不绑定域名 就是*.域名的默认访问页. 第三步:默认页里加入以下代码:关键部分如下: string sURL=context.Request.ServerVariables[ "HTTP_HOST "].ToLower(); sURL就是获取的域名部分 . xxx.域名 对应的xxx就是用户名.然后查库里的记录,如xxx对应的是www.csd.net那就就把 它转向到www.csdn.net 或者写一个框架 阅读全文
posted @ 2011-04-14 16:20 西湖浪子 阅读(604) 评论(0) 推荐(0)
C#验证码识别类
摘要:usingSystem; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.Collections; usingSystem.Drawing; usingSystem.Drawing.Imaging; usingSystem.Runtime.InteropServices; namespaceBallotAiying2 ...{ classUnCodebase ...{ publicBitmapbmpobj; publicUnCodebase(Bitmappic) ...{ bmpobj=newBitmap(pic); 阅读全文
posted @ 2011-04-06 17:05 西湖浪子 阅读(572) 评论(0) 推荐(0)
CSS实现网页内容分页打印
摘要:在需要分页的地方加上“page-break-before:always”或“page-break-after:always”即可,相应的,有两种代码:利用“page-break-before:always”:第一页的内容<p style="page-break-before:always;">第二页的内容</p><p style="page-break-before:always;">第三页的内容</p>利用“page-break-after:alwaysR 阅读全文
posted @ 2011-02-18 12:49 西湖浪子 阅读(217) 评论(0) 推荐(1)
sql 还能这样写
摘要:with o as (select orderid,ISNULL(UTaxRate,0) AS UTaxRatefrom [order] (nolock)where sourceid not in (21,22)), l as (select o.orderid,oit.orderlineitemid,cast(o.UTaxRate as decimal(10,8)) as UTaxRate,cast(ISNULL(oit.TaxRate,0) as decimal(10,8)) as LineRatefrom ojoin dbo.Order_Line_Item oi (nolock)on o 阅读全文
posted @ 2011-02-17 11:04 西湖浪子 阅读(138) 评论(0) 推荐(0)
ajax的updatepanel 和timer造成的問題
摘要:請問使用ajax的updatepanel 和timer在timer_tick時有時會出現藍色視窗error,內容為...Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.The status code re... 阅读全文
posted @ 2010-10-01 11:00 西湖浪子 阅读(268) 评论(0) 推荐(0)
将文件反序列化为对象
摘要:/// <summary> ///将文件反序列化为对象 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="saveKey"></param> /// <param name="appRoot"></param> //... 阅读全文
posted @ 2010-07-07 06:48 西湖浪子 阅读(177) 评论(0) 推荐(0)
Windows API函数大全四
摘要:10. API之硬件与系统函数 ActivateKeyboardLayout 激活一个新的键盘布局。键盘布局定义了按键在一种物理性键盘上的位置与含义 Beep 用于生成简单的声音 CharToOem 将一个字串从ANSI字符集转换到OEM字符集 ClipCursor 将指针限制到指定区域 ConvertDefaultLocale 将一个特殊的地方标识符转换成真实的地方ID CreateCaret ... 阅读全文
posted @ 2010-06-27 11:13 西湖浪子 阅读(321) 评论(0) 推荐(0)
Windows API函数大全三
摘要:7. API之位图、图标和光栅运算函数 BitBlt 将一幅位图从一个设备场景复制到另一个 CopyIcon 制作指定图标或鼠标指针的一个副本。这个副本从属于发出调用的应用程序 CopyImage 复制位图、图标或指针,同时在复制过程中进行一些转换工作 CreateBitmap 按照规定的格式创建一幅与设备有关位图 CreateBitmapIndirect 创建一幅与设备有关位图 CreateCo... 阅读全文
posted @ 2010-06-27 11:12 西湖浪子 阅读(162) 评论(0) 推荐(0)
Windows API函数大全二
摘要:4. API之打印函数 AbortDoc 取消一份文档的打印 AbortPrinter 删除与一台打印机关联在一起的缓冲文件 AddForm 为打印机的表单列表添加一个新表单 AddJob 用于获取一个有效的路径名,以便用它为作业创建一个后台打印文件。它也会为作业分配一个作业编号 AddMonitor 为系统添加一个打印机监视器 AddPort 启动"添加端口"对话框,允许用户在系统可用端口列表中... 阅读全文
posted @ 2010-06-27 11:11 西湖浪子 阅读(231) 评论(0) 推荐(0)
Windows API函数大全一
摘要:1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnection 结束一个网络连接 WNetCancelConnection2 结束一个网络连接 WNetCloseEnum 结束一次枚举操作 ... 阅读全文
posted @ 2010-06-27 11:09 西湖浪子 阅读(183) 评论(0) 推荐(0)
windows锁屏API
摘要:新近找到了windows锁屏API:LockWorkStation于是乎把之前的关屏API整合了一下,弄了个可以选择自动锁屏+关屏的东东。如下代码片段:[代码]需要指出的是,在退出程序时使用Environment.Exit( 0 );而非Application.Exit();否则会出错哦~~提示类似:“***遇到错误,需要关闭”。还有就是修改一下Main:[代码]..如此即... 阅读全文
posted @ 2010-06-27 11:01 西湖浪子 阅读(1020) 评论(0) 推荐(0)
RSA Encryption in C#
摘要:What is Encryption?Encryption is the process of converting a string of characters into another such that the original characters cannot be deciphered upon examination. This process is performed with t... 阅读全文
posted @ 2010-05-07 16:09 西湖浪子 阅读(501) 评论(0) 推荐(0)
SessionHelper
摘要:这个看介绍,感觉还是一个很不错的类,可是在使用上,我感觉还是有所保留,特别是对于旧项目中要引用这个类,对项目的改动还是会大了些。不管怎么样,以后新的项目可以试试这个类的使用,到时在来详细的介绍一个类如果你想用了解更多的SessionHelper介绍,请点击  using System;using System.Collections.Generic;using System.Web;using S... 阅读全文
posted @ 2010-05-06 18:03 西湖浪子 阅读(2299) 评论(1) 推荐(0)
RSA 加密算法
摘要:using System;using System.Security.Cryptography;class Class1{ static void Main() { //Initialize the byte arrays to the public key information. byte[] PublicKey = {214,46,220,83,160,73,40,39,201,155,19... 阅读全文
posted @ 2010-05-06 17:50 西湖浪子 阅读(254) 评论(0) 推荐(0)
正则表达式规则
摘要:正则表达式通常包含字母文本(Literal text)和元字符(metacharacter) 字母文本指的是普通文本如"abcde"可匹配字符串中任何包含"abcde"的字符串。元字符则更加灵活运用通用的表达式匹配所有符合此表达式规律的字符串。一、匹配单个字符 [ ]——从中选择一个字符匹配中间支持的类型:单词字符([ae])、非单词字符([!?,;@#$*])、字母范围(... 阅读全文
posted @ 2010-04-18 18:28 西湖浪子 阅读(309) 评论(0) 推荐(0)
WebBrowser
摘要:webBrower控件实现winform和webpage交互要求:dom基础+javascript脚本应用:自动填充webform抓取webpage数据添加WebBrowser控件privateWebBrowserwebBrowser1;引用页面的document对象HtmlDocumentdoc=webBrowser1.Document;//getwebdocument有了document对象,... 阅读全文
posted @ 2010-04-18 13:02 西湖浪子 阅读(523) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 下一页