TA的每日心情 | 开心 2026-3-29 18:09 |
|---|
签到天数: 698 天 连续签到: 1 天 [LV.9]以坛为家II 论坛元老
 
- UID
- 29057
- 小七币
- 835
- 贡献
- 0
- 在线时间
- 1213 小时
- 注册时间
- 2014-6-16
   
|
防上传代码
#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;
} |
|