main.cpp

来自「email client and support pop3、smtp、imap 」· C++ 代码 · 共 53 行

CPP
53
字号
#include "stdio.h"
#include "string.h"

void main()
{

	printf("This program converts the old popuser.ctl to the new format of Inetserv > 2.5\nLooking for popuser.ctl...");
	FILE *fp,*fpx;
	fp = fopen ("popuser.ctl","rt");
	char t1[255];
	char t2[255];
	char t3[255];

	if (fp == NULL)
	{
		printf("popuser.ctl not found.");
		return;
	}
		printf("Found.\nConverting...");
	
		fpx = fopen ("popuser.new","wt");
	char tempstr[255];
	while (!feof(fp))
	{
		fgets(tempstr,255,fp);
		sprintf(t1,"%s",tempstr);
		fgets(tempstr,255,fp);
		sprintf(t2,"%s",tempstr);
		fgets(tempstr,255,fp);
		sprintf(t3,"%s",tempstr);


		t1[strlen(t1)-1] = '\0';
		t2[strlen(t2)-1] = '\0';
		t3[strlen(t3)-1] = '\0';

		if (!feof(fp))
		{
			
			fprintf(fpx,"\'%s\';\'%s\';\'\';\'%s\'\r\n",t2,t3,t1);
			


		}
	}
	fclose(fpx);
	fclose(fp);


	printf("Done.\nRename popuser.new to popuser.ctl and try it.");
		return;

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?