05 2014 档案
实现窗口移动
摘要:#region 实现窗口移动 private bool m_isMouseDown = false; private Point m_mousePos = new Point(); protected override void OnMouseDown(Mo... 阅读全文
posted @ 2014-05-29 07:52 13m0n 阅读(202) 评论(0) 推荐(0)
rand(7) 到rand(10)
摘要:说有一个rand()函数,等概率生成1-7的随机数.利用这个函数,构造一个能生成1-10的随机数的函数; //意思大家都懂就好,没说清的就按照想象的走我想只要输出的10个数概率相同就好,从宏观上看,这个函数的返回值每个都是1/10就好.int get10(){ srand((... 阅读全文
posted @ 2014-05-27 15:44 13m0n 阅读(278) 评论(0) 推荐(0)
c++生成随机数
摘要:#include#include#include#define random(x) (rand()%x)void main(){ srand((int)time(0)); for(int x=0;x<10;x++) printf("%d/n",random(100... 阅读全文
posted @ 2014-05-27 15:31 13m0n 阅读(159) 评论(0) 推荐(0)
批量该文件名
摘要:ren *.txt *.xls 阅读全文
posted @ 2014-05-22 19:44 13m0n 阅读(129) 评论(0) 推荐(0)
正则表达式(=)
摘要:(?=exp)\w+ //匹配后面接着exp的\w+(?<=exp)\w+ //匹配前面是exp的\w+关键字:\ . = - ^ * + ( ) [ ] { } //(以后再补充吧)MSDN的regex类 阅读全文
posted @ 2014-05-22 03:25 13m0n 阅读(185) 评论(0) 推荐(0)
简单的下载网上文件的方法
摘要:wc.Headers.Add("User-Agent", "Chrome"); wc.DownloadFile(url, @"d:\1.jpg");//保存到本地的文件名和路径,请自行更改 阅读全文
posted @ 2014-05-21 14:37 13m0n 阅读(168) 评论(0) 推荐(0)
[疑问]静态变量访问
摘要:今天写聊天程序,端口同时只能占用一次,每新建一个对话窗口,就需要给这个窗口分配udp.send()和udp.receive() //可能有更好的方法,我这里暂时先这么做我想的是给把send()和receive()写成静态函数;另一个是client声明成静态的,这样对话框类里就可以每次实例化... 阅读全文
posted @ 2014-05-20 03:45 13m0n 阅读(194) 评论(0) 推荐(0)
[转转!!]文件拼接
摘要:任务说明:把很多TXT文本文件中的文字全部提取出来生成一个新的TXT文件,但又不想使用反复复制和粘贴这种笨 拙、耗时的方法。任务执行: 首先,将所有文本文件都放在同一个文件夹中。然后,调出“命令提示符”窗口。如果不必按顺序合并所有TXT文件,则输入“copy *.txt new.txt”即可任务说... 阅读全文
posted @ 2014-05-19 16:18 13m0n 阅读(215) 评论(0) 推荐(0)
下载生物信息
摘要:http://www.catalogueoflife.org/col/browse/classification这是一个国外的生物信息网站今天的代码可以抓取指定分类的信息(id,学名)没有把多线程写进去,略失败...运用:webclient,regex,io项目在>>>开源中国 1 using Sy... 阅读全文
posted @ 2014-05-19 16:13 13m0n 阅读(261) 评论(0) 推荐(0)
多线程尝试
摘要:public partial class Form1 : Form { Thread m; int i = 0; public Form1() { InitializeComponent(); ... 阅读全文
posted @ 2014-05-15 17:47 13m0n 阅读(133) 评论(0) 推荐(0)
多个窗口程序退出
摘要:背景略 窗体A,窗体B 事件a { A.Hide(); B.Show(); } 事件b { Application.Exit() //Environment.Exit(0); } 此时程序并没有退出,在任... 阅读全文
posted @ 2014-05-15 17:33 13m0n 阅读(129) 评论(0) 推荐(0)
局域网聊天软件项目小结(1)
摘要:考虑局域网里没有服务器,而且我自己偏向想做一个像(飞秋)一样的程序. 所以我的思路是,每个程序里都有个udp sever和client 一个新用户上线时向5556端口广播上线信息 每个client收到信息之后更新自己的用户表 同时向该用户发送自己的用户信息. 聊天时,建议采用udp... 阅读全文
posted @ 2014-05-15 17:28 13m0n 阅读(224) 评论(0) 推荐(0)
IPAddress类
摘要:using System.Net;IPAddress ad1=IPAddress.Parse("192.168.1.1"); //ip为192.168.1.1的地址IPAddress ad2=IPAddress.Loopback; //127.0.0.1IPAddress ad3=IPAddre... 阅读全文
posted @ 2014-05-12 00:32 13m0n 阅读(255) 评论(0) 推荐(0)
Combobox 成员添加
摘要:this.comboBox1.Items.AddRange(new object[] {"Item 1", "Item 2", "Item 3", "Item 4... 阅读全文
posted @ 2014-05-07 15:33 13m0n 阅读(175) 评论(0) 推荐(0)
tcpclient 类
摘要:1. 构造函数 1) 类对象将套接字与本地系统地址和一个随机的tcp端口号进行绑定. 在默认的tcpclient 对象创建后,必须使用connect方法与远程设备连接.TcpClient tc = new TcpClient();tc.Connect("www.baidu.com",8000);... 阅读全文
posted @ 2014-05-02 04:05 13m0n 阅读(1049) 评论(0) 推荐(0)
console.read()读入的内容
摘要:今天写的特别简单的代码,大体是一个模式选择,从控制台读入一个数,然后做出相应的选择. 代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Thre... 阅读全文
posted @ 2014-05-01 03:19 13m0n 阅读(877) 评论(0) 推荐(0)