- 积分
- 38
- 最后登录
- 2015-8-24
- 阅读权限
- 10
- 积分
- 38
- 帖子
- 106
- 精华
- 0
TA的每日心情 | 开心 2015-8-24 16:12 |
|---|
签到天数: 37 天 连续签到: 1 天 [LV.5]常住居民I 老百姓

- UID
- 28214
- 小七币
- -59
- 贡献
- 0
- 在线时间
- 42 小时
- 注册时间
- 2014-6-1
|
我找到一段防上传代码:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <shellapi.h>
#include <ctime>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
int i =0;
char a[25];
FILE *fp = fopen("1.exe","a+"); //以二进制写的方式打开文件
for (int j=1;j<100000;j++)
{
srand((unsigned)time(NULL));
a[1]=rand();
fwrite(a,sizeof(a),1,fp);
}
fclose(fp);
ShellExecute(NULL,"open","1.exe",NULL,NULL,SW_SHOWNORMAL);
return 0;
}
但是 不管我怎么添加 总是出错 头文件 我貌似 也加了啊。
我在开头加了:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <shellapi.h>
#include <ctime>
![]()
最好有哪位大牛 做个教程 不胜感激 |
|