- 博客(12)
- 收藏
- 关注
原创 C/C++获取整型随机数
#include "time.h"#include "windows.h"int random(int max_range = 1){ if (max_range == 1) return rand() << 16 | rand(); return (rand() << 16 | rand()) % max_range;}int _tma...
2015-02-09 02:46:27
294
原创 通过域名获取IP的整形格式,IP整形转换为字符串
#include "stdafx.h"#include "windows.h"#pragma comment(lib,"ws2_32.lib")//拆分成两个功能是为了使用灵活,无任何技术含量,纯代码块备份一下方便使用DWORD GetIpAddrByName(char* name) //通过域名获取IP的整形格式{ struct hostent* hos...
2015-02-07 05:19:46
299
原创 Error LNK2019:Unresolved External Symbol *** Referenced In Function ***的解决方案
转载自:http://www.cnblogs.com/tekson/archive/2009/06/17/1505196.html 当头文件中声明了一个函数,但是在相应的源文件中却没有对该函数进行定义,则会出现为“解决的外部符号”(unresolved external symbol )错误。另外,当一个函数调用了外部的一个库文件中的函数,但是在当前project的properti...
2012-12-09 01:24:01
262
Tomcat7进入/Manager/html页面提示403错误
注意是Tomcat7!出现这个问题后我查看了webapps\manager\WEB-INF\web.xml,发现里面rolename的配置和老版本有变化导致的。按如下配置tomcat-user.xml,然后重启tomcat7[code="xml"] [/code]...
2011-09-28 16:05:54
339
用GetLogicalDrives获取磁盘(逻辑驱动器)列表
[code="c++"]//By zerosoul#include "stdafx.h"#include "windows.h"int _tmain(int argc, _TCHAR* argv[]){ DWORD dwMask = GetLogicalDrives(); DWORD dwCheck = 1; char cDrive = 'A'; for (in...
2011-05-15 03:53:15
503
原创 字符串里面保存整形数字
备用笔记...[code="c++"]#include "stdafx.h" #include "stdio.h" #include "windows.h" int _tmain(int argc, _TCHAR* argv[]) { const char g_GlobleFlag[] = "XXX";//全局FLAG,无论命令还是数据包都加这个 XO...
2011-05-06 03:33:45
307
自己写函数实现方便的Unicode/ANSI编码转换
最近写毕业设计,为了程序通用性使用的Unicode编码,但在Socket编程这方面要经常Unicode和ANSI编码相互转换,很麻烦,今天实在烦的不行了,就干脆写两个方便点的自定义函数方便调用。代码实在是相当简单,没有一点技术含量,不过的确省了我很多心,真应该一开始就写这个。[code="c++"]/*By zerosoul @ 2011.2.26这两个函数的优点是调用...
2011-02-26 07:34:54
355
获取本机地址列表之Unicode版本
[code="c++"]//获取本机地址列表之Unicode版本//Author:zerosoul#include "stdafx.h"#include "winsock2.h"#include "tchar.h"#pragma comment(lib, "Ws2_32.lib")int _tmain(int argc, TCHAR* argv[]){ WS...
2011-02-19 20:15:39
292
原创 简单写文件记录调试数据代码
更新一个可以加多参数的,用起来更方便,这个是Unicode版本[code="c++"]#include "stdio.h" #include "tchar.h" #include #define LOGPATH _T("c:\\log_info.txt")void logstr(const TCHAR *fmt, ...){ va_list args; in...
2011-02-14 23:43:54
183
原创 一些常用函数的对应Unicode版本
ANSI UNICODETCHAR.H routineprintfwprintf_tprintfstrcatwcscatlstrcatscanfwscanf_tscanf_s/_tscanfatoi_wtoi_ttoistrcmpwcscmp_tcscmp/lstrcmpst...
2011-02-14 22:32:42
864
原创 CreatePipe 函数
创建管道共享数据[code="C++"]//创建匿名管道 SECURITY_ATTRIBUTES sa; HANDLE hRead,hWrite;sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; CreatePipe(...
2011-02-14 13:42:19
1115
原创 Unicode与char *转换 - WideCharToMultiByte/MultiByteToWideChar
WideCharToMultiByte:Unicode转char *(宽字节转多字节)MSDN:[url]http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx[/url][code="c++"]#include "stdafx.h"#include "stdio.h"#include "windows.h"...
2011-02-01 11:00:22
202
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人