ITPub博客

首页 > 应用开发 > IT综合 > VC弹窗

VC弹窗

原创 IT综合 作者:xiaoqi003 时间:2007-04-12 17:20:08 0 删除 编辑
// CCASP.cpp : Defines the entry point for the application.

#include "stdafx.h"

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//永远执行下去
while(1)
{
//调用一个ini里的文件,读出相关的键值并在ctime中执行
/*
判断当一个文件不存在时创建初始化文件
*/
if( (_access( "c:ON_ZCM_LSM_PRM_URL_ASP.ini", 0 )) == -1 )
{
char str1[]="[url]";
char str2[]="url=http://www.84ren.net";

char str3[]="[Onit]";
char str4[]="onit=1";

char str5[]="[Time]";
char str6[]="Time=1";

ofstream a("c:ON_ZCM_LSM_PRM_URL_ASP.ini");

a<
}
//读取相关的数据
CString strUrlName; //执行的url的名称
int nUrlonit; //执行的url的次数
int nTime; //执行的url的时间段 以秒为单位
//
//读取网址
//
GetPrivateProfileString(
"url",
"url",
"Zcm&Lsm",
strUrlName.GetBuffer(MAX_PATH),
MAX_PATH,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
//
//读取执行次数
//
nUrlonit=GetPrivateProfileInt(
"Onit",
"Onit",1,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
nTime=GetPrivateProfileInt(
"Time",
"Time",1,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
//
//执行一个循环用来书写时间间隔的执行代码
//

while(nUrlonit!=0)
{
//执行对应的网站url

ShellExecute(NULL, "open", strUrlName, NULL, NULL, SW_SHOWNORMAL);
//循环时间端,以秒为单位
while(nTime!=0)
{
Sleep(1000);
nTime--;
}
nUrlonit--;
}
}

return 0;
}
[@more@]// CCASP.cpp : Defines the entry point for the application.

#include "stdafx.h"

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//永远执行下去
while(1)
{
//调用一个ini里的文件,读出相关的键值并在ctime中执行
/*
判断当一个文件不存在时创建初始化文件
*/
if( (_access( "c:ON_ZCM_LSM_PRM_URL_ASP.ini", 0 )) == -1 )
{
char str1[]="[url]";
char str2[]="url=http://www.84ren.net";

char str3[]="[Onit]";
char str4[]="onit=1";

char str5[]="[Time]";
char str6[]="Time=1";

ofstream a("c:ON_ZCM_LSM_PRM_URL_ASP.ini");

a<
}
//读取相关的数据
CString strUrlName; //执行的url的名称
int nUrlonit; //执行的url的次数
int nTime; //执行的url的时间段 以秒为单位
//
//读取网址
//
GetPrivateProfileString(
"url",
"url",
"Zcm&Lsm",
strUrlName.GetBuffer(MAX_PATH),
MAX_PATH,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
//
//读取执行次数
//
nUrlonit=GetPrivateProfileInt(
"Onit",
"Onit",1,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
nTime=GetPrivateProfileInt(
"Time",
"Time",1,
"c:ON_ZCM_LSM_PRM_URL_ASP.ini");
//
//执行一个循环用来书写时间间隔的执行代码
//

while(nUrlonit!=0)
{
//执行对应的网站url

ShellExecute(NULL, "open", strUrlName, NULL, NULL, SW_SHOWNORMAL);
//循环时间端,以秒为单位
while(nTime!=0)
{
Sleep(1000);
nTime--;
}
nUrlonit--;
}
}

return 0;
}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/711001/viewspace-910266/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 最近的生活
下一篇: 开发弹窗
请登录后发表评论 登录
全部评论
  • 博文量
    14
  • 访问量
    163558