编程

C#读写文件

C#读写文件的方法: C#中,在含有转义字符的 字符串前加@可以避免使用转义字符 使用前要using System.IO; StreamReader reader = new StreamReader(@"E:/main.c", Encoding.Default); strin...

Windows下秒建大文件

Windows下秒建大文件的方法: 执行命令:F:/>fsutil file createnew wu 20480000000返回:已创建文件 F:/wu 也可以使用API SetEndOfFile

warning:could not find /tmp. please create! 的错误解决

Cygwin B20运行出现如下警告信息: bash.exe:warning:could not find /tmp. please create! bash-2.05b$  解决办法如下: 到 cygwin 目录下(如果用cygnus,可能是cygnus/cygwin-b20目录) mkdir /tmp  c...

C语言拆分字符串strtok

C语言拆分字符串strtok函数 Example /* STRTOK.C: In this program, a loop uses strtok * to print all the tokens (separated by commas * or blanks) in the string named "string". */ #include <s...

用CHtmlView接口获取HTML源文件

用CHtmlView接口获取HTML源文件: 支持在UNICODE工程下获取HTML代码,无乱码。。。。发了两年多了才知道,害得我找了一晚上,没想到自己的博客里就有。。。 BOOL CWeb::GetSource(CString& strString)...

VC中, 关于UNICODE的L和_T()

1.  UNICODE项目下,字符串用L是可以的,但项目再转成 多字节编码时, L就不能编译通过 2.  如果用_T() 或 _TEXT()则可以在UINCODE和多字节编码项目下 都 可以无修改编译通过

关于gethostname函数失败的问题

调用gethostname函数失败。 解决办法:调用gethostname之前, 要先调用WSAStartup才可以, 否则gethostname会失败! 下面是正确的代码 #include <stdio.h> #include <stdlib.h> #include <...

C语言十进制转二进制(移位法)

C语言十进制转二进制(移位法) #include <stdio.h> int main() { char strBinary[sizeof(int)*8+1]; int a = 100; // 让p指向strBinary的最后一位 char *p = strBinary + sizeof(int)*8; *p = ...

sqlplus启动问题

问题: Error 6 initializing SQL*PLUS.Message file spl .msb not found.SP2-0750:You may need to set ORACLE_HOME to your Oracle software directory. 同时PLSQL Developer登陆界面数据库下拉列表没有...