摘要:拖动无边框窗体Form至桌面任何位置首先建一个Windows应用程序将Form1的 FormBorderStyle属性设置为Noe 1 Point mouseOff;//鼠标移动位置变量 2 bool leftFlag;//标记是否为左键 3 private void Form1_MouseDown(object sender, MouseEventArgs e) 4 { 5 if (e.Button == MouseButtons.Left) 6 { 7 mous...
阅读全文
随笔分类 - winform
摘要:DateTime dt = DateTime.Now;Label1.Text = dt.ToString();//2005-11-5 13:21:25 Label2.Text = dt.ToFileTime().ToString();//127756416859912816 Label3.Text = dt.ToFileTimeUtc().ToString();//127756704859912816 Label4.Text = dt.ToLocalTime().ToString();//2005-11-5 21:21:25 Label5.Text = dt.ToLongDateString(
阅读全文
摘要:首先:编写一个调用系统资源的大类,代码如下using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.Diagnostics;using System.IO;namespace DOS工具箱{ public class 调用系统资源...
阅读全文
摘要:public static void 打开控制面板多媒体属性音频() { Process.Start("rundll32.exe", " shell32.dll,Control_RunDLL mmsys.cpl,,0"); } public static void 打开控制面板多媒体属性视频() { Process.Start("rundll32.exe", " shell32.dll,Contr...
阅读全文
摘要:最近写程序,需要使用C#应用程序访问一网站,获取相应的Cookie,然后使用该Cookie用IE浏览器打开指定的页面。恩,好比用QQ打开浏览器自动登录你的QQ空间。从网上了解了下,一般都是用非托管动态链接库来实现,具体如下:声明部分代码:using System.Runtime.InteropServices;读取函数[DllImport("wininet.dll", CharSet = Char...
阅读全文
摘要:像QQ、百度hi等等即时通讯软件都有这种功能,就是你点击客户端的一些按钮,打开的网页都是已经登录了的,因为客户端已经登录过了,不用在网页上重新登录一遍。 今天在百度知道上一个网友遇到这个问题,我就花时间研究一下,帮忙解决了。 用C#实现起来也比较简单(但有一个条件,网页登陆的时候不能有验证码),就是先用HttpWebRequest登陆获取到cookie值,然后再把cookie写到浏览器的coo...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace 生成N个不重复随机数的两个函数 { class Program { static void Main(string[] args) { DateTime d1 = System.DateTime...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace jayleke{ public class HttpHelper { #region 私有变量 private static CookieC...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO;namespace Czt.Web { /// <summary> /// 实现网站登录类 /// </summary> public class Post { /// &l...
阅读全文

浙公网安备 33010602011771号