// 网络组纳新抽题系统.cpp : Defines the entry point for the application.
//
//
#include "stdafx.h"
#include "resource.h"
#include "MainDlg.h"
#include <COMMCTRL.H>
#include "resource.h"
#include "MainDlg.h"
#include <COMMCTRL.H>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//Enable IPAddress、Calendar.etc
InitCommonControls();
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, Main_Proc);
return 0;
}
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//Enable IPAddress、Calendar.etc
InitCommonControls();
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, Main_Proc);
return 0;
}
#include "stdafx.h"
#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#include "MainDlg.h"
#include <stdlib.h>
#include <time.h>
#include <fstream>
#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#include "MainDlg.h"
#include <stdlib.h>
#include <time.h>
#include <fstream>
BOOL WINAPI Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
HANDLE_MSG(hWnd, WM_INITDIALOG, Main_OnInitDialog);
HANDLE_MSG(hWnd, WM_COMMAND, Main_OnCommand);
HANDLE_MSG(hWnd, WM_CLOSE, Main_OnClose);
}
{
switch(uMsg)
{
HANDLE_MSG(hWnd, WM_INITDIALOG, Main_OnInitDialog);
HANDLE_MSG(hWnd, WM_COMMAND, Main_OnCommand);
HANDLE_MSG(hWnd, WM_CLOSE, Main_OnClose);
}
return FALSE;
}
}
BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
return TRUE;
}
{
return TRUE;
}
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
switch(id)
{
case IDC_OK:
{
{
switch(id)
{
case IDC_OK:
{
读取
char details[2000];
std::fstream fin;
fin.open("常规题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了常规题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
std::fstream fin;
fin.open("常规题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了常规题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
// 抽取随机数 //
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
// 寻找输出 /
int line;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
case IDC_OK2:
{
{
读取
char details[2000];
std::fstream fin;
fin.open("创新题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了创意题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
std::fstream fin;
fin.open("创新题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了创意题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
// 抽取随机数 //
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
// 寻找输出 /
int line;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
case IDC_OK3:
{
{
读取
char details[2000];
std::fstream fin;
fin.open("技术题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了技术题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
std::fstream fin;
fin.open("技术题.txt",std::ios::in|std::ios::binary);
if(!fin){
MessageBox(hwnd,TEXT("请将程序放入文件夹中运行,现在丢失了技术题的txt文件"),TEXT("警告"),MB_OK|MB_ICONEXCLAMATION);
break;
}
for(int k=0;!fin.eof();k++){
details[k]=fin.get();
}
details[k-1]='\0';
fin.close();
// 抽取随机数 //
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
char *p;
int num = 0; //记录题目数
for(p = details;*p!='\n';p++)
{
if(*p>='0'&&*p<='9')
num = *p-48+num*10;
}
p++;
srand((unsigned)time(NULL));
int suiji=rand()%num+1;
suiji = 2*suiji-1;
// 寻找输出 /
int line;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
for(line=1;line<suiji;line++)
{
for(;*p!='\n';p++);
p++;
}
char m1[500];
for(int dd=0;*p!='\n';p++,dd++)
{
m1[dd] = *p;
}
m1[dd-1] = '\0';
p++;
char m2[500];
SetDlgItemText(hwnd,IDC_EDIT1,m1);
for(int ddd=0;*p!='\n';p++,ddd++)
{
m2[ddd] = *p;
}
m2[ddd-1] = '\0';
p++;
SetDlgItemText(hwnd,IDC_EDIT2,m2);
}
break;
default:
break;
}
}
break;
}
}
void Main_OnClose(HWND hwnd)
{
EndDialog(hwnd, 0);
}
{
EndDialog(hwnd, 0);
}
// stdafx.cpp : source file that includes just the standard includes
// 网络组纳新抽题系统.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
// 网络组纳新抽题系统.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
// and not in this file
#ifndef _MAIN_H
#define _MAIN_H
#define _MAIN_H
#include <windows.h>
BOOL WINAPI Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
void Main_OnClose(HWND hwnd);
BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
void Main_OnClose(HWND hwnd);
#endif
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by resource.rc
//
#define IDD_MAIN 101
#define IDR_DEFAULT1 103
#define IDI_ICON1 104
#define IDB_BITMAP1 105
#define IDB_BITMAP2 106
#define IDR_BI1 107
#define IDB_BITMAP3 108
#define IDB_BITMAP4 109
#define IDB_BITMAP5 110
#define IDC_OK 1000
#define IDC_OK2 1001
#define IDC_OK3 1002
#define IDC_EDIT1 1004
#define IDC_EDIT2 1005
// Microsoft Developer Studio generated include file.
// Used by resource.rc
//
#define IDD_MAIN 101
#define IDR_DEFAULT1 103
#define IDI_ICON1 104
#define IDB_BITMAP1 105
#define IDB_BITMAP2 106
#define IDR_BI1 107
#define IDB_BITMAP3 108
#define IDB_BITMAP4 109
#define IDB_BITMAP5 110
#define IDC_OK 1000
#define IDC_OK2 1001
#define IDC_OK3 1002
#define IDC_EDIT1 1004
#define IDC_EDIT2 1005
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
// or project specific include files that are used frequently, but
// are changed infrequently
//
#define _WIN32_WINNT 0x0501
#define _WIN32_IE 0x0600
#define WINVER 0x0501
#define _WIN32_IE 0x0600
#define WINVER 0x0501
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)