03 2013 档案
摘要:int load(char * filaName , char *& buffer){ FILE *file; if((file = fopen("D://a.txt","r")) == NULL) { printf("cant open file!"); } fseek (file, 0, SEEK_END); // non-portable char *c = ""; int size=ftell (file); rewind (file); buffer = new char[size+1]; *(b
阅读全文
摘要:读文件到文件尾 FILE *file; if((file = fopen("D://a.txt","r")) == NULL) { printf("cant open file!"); } char ch; while((ch = fgetc(file))!=EOF) putchar(ch); if(fclose(file)) printf("file close error!");从键盘输入字符存入文件 FILE *file; if((file = fopen("D://a.txt",&quo
阅读全文
摘要:绑定元素的大小一般会想到Width和Height但是wpf里的Width和Height如果没有显示的设置过大小那么得到的就是NaN要动态得到元素的大小要用ActualWidth、ActualHeight<UserControl x:Class="园区展示程序.MyRichTextBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" .
阅读全文
摘要:在wpf和C#中Environment.TickCount可以用来获得系统开机到现在的毫秒数
阅读全文
摘要:Mouse.GetPosition(window);可以在任何时间获得相对任意元素的鼠标位置Mouse.Capture(el);可以让某个元素获得所有的鼠标事件不管他应不应该的到鼠标事件Mouse.Capture(null);解除
阅读全文
摘要:this.image.Source = new BitmapImage(new Uri(imgSource, UriKind.Absolute)); this.imgSource = imgSource;
阅读全文
摘要:组件放在ViewBox里,在大小变化的时候字体大小会自动缩放,测试Button放到ViewBox里是这样的。
阅读全文
摘要:转自:http://hi.baidu.com/superql/item/0d40d5346463a4302f0f8124使用正则表达式可以很好地完成很多繁琐耗时的工作,以下抄录editplus正则表达式的使用,同样适用于notepad++:使用注意事项:1.要用半角输入也就是标准英文输入2.拷贝别人的表达式要注意是否有空格或者非标准字符3.应当用测试工具加以测试(refer to正则表达式30分钟入门教程)4.注意notepad++ 与其他软件对正则表达式的定义的细微区别表达式 说明\t 制表符.\n 新行.. 匹配任意字符.| 匹配表达式左边和右边的字符. 例如, "ab|bc&q
阅读全文
摘要:转自:http://www.cnblogs.com/suding1188/archive/2012/03/12/2392021.html在工作中适当地使用一些技巧,总可以让我们提高效率和准确率。在 Notepad++ 中使用正则表达式进行高级查找替换,对于一些批量性质的工作是很有帮助的。我们来看下面一个例子:这是在剑南春项目中遇到的一个实际问题。要求是在数据库 MISC_SERIAL_QUEUE 表中写入一大批模拟序列号数据,大致为这样的形式:012345678900000000010123456789000000000201234567890000000003……当然,该表还有一些其他字段,
阅读全文
摘要:转自:http://www.cnblogs.com/hbb0b0/archive/2013/02/06/2907707.html本文说明已知其它进程变量所在地址,如何读取此进程变量地址所保存的信息Win32ReadMemTest的代码如下#include "stdafx.h"#include "windows.h"int add(int a,int b);typedef int (*func)(int,int);int _tmain(int argc, _TCHAR* argv[]){ DWORD number=10000; DWORD *ptr=&am
阅读全文
摘要:http://docs.python.org/3.4/library/urllib.request.html#module-urllib.request
阅读全文

浙公网安备 33010602011771号