C++ URL Daquan

Recently, I have nothing to do to make a website. In fact, the inspiration is also borrowed from others.

Click below when you see this article, let me know how many people have seen this article

Specific functions:

1. You can enter a URL and open the URL

It's such a humble start page

Enter URL:

 

URL navigation bar

Check it out for yourself below

The code both devc++ and VS can run

#include<windows.h>
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
void out(string o)
{
	for(int i=0;i<o.size();i++)//输出 
	{
		cout<<o[i];
		Sleep(80);
	}
}
string str(string n)
{
	n = "start " + n;//打开的网址 因为用system打开 所以要拼接 
	return n;
}
void pos(long long x, long long y, string str)
{
	for (long long i = 1; i <= x; i++)
		cout<<endl;//在第几行输出 是第几列就输出多少个endl 
	for (long long i = 1; i <= y; i++)
		cout<<" ";//在第几列输出 是第几列就输出多少个空格 
	cout << str;
	return;
}

void move(int x, int y)
{
	COORD pos = { x,y };
	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);// 获取标准输出设备句柄
	SetConsoleCursorPosition(hOut, pos);//两个参数分别是指定哪个窗体,具体位置
}
int main()
{
	system("color F0");//颜色 
	start:
		for(int i=0;i<8;i++)cout<<endl;//行 
		cout<<"                                    ";//列
		out("按1输入网址");
		cout<<endl<<endl;
		cout<<"                                    ";
		out("按2网址导航栏");
		cout<<endl<<endl;
		cout<<"                                    ";
		out("按3小调查");
		cout<<endl<<endl;
		cout<<"                                            ";
		out("made with YR_T");
		int ch=_getch();
		while(ch!='1'&&ch!='2'&&ch!='3')ch=_getch();
		if (ch=='1')
		{
			system("cls");
			for(int i=0;i<8;i++)cout<<endl;//行 
			cout<<"                                    ";//列 
			out("网址打开");
			pos(1,15,"-----------------------------------------------------");
			pos(1,15,"|输入网址:                                           |");
			pos(1,15,"-----------------------------------------------------");
			move(25,10);//移动光标到输入网址后面 
			string url;
			cin>>url;
			url = str(url);//网址前面加上start 
			system(&url[0]);//打开 
			system("cls");
			goto start;//虽然乱但好用 
		}
		if (ch=='2')
		{
			system("cls");//清屏 
			for(int i=0;i<11;i++)cout<<endl;//行
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"输入1.百度"<<endl;//  https://www.baidu.com
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    2.github"<<endl;//  https://github.com
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    3.CSDN"<<endl;//  https://csdn.net
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    4.vrcworld"<<endl; // http://www.vrcworld.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    5.爱奇艺"<<endl;//  https://www.iqiyi.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    6.优酷"<<endl;//  https://www.youku.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    7.bilibili"<<endl;//  https://www.bilibili.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    8.洛谷"<<endl;//  https://www.luogu.com.cn/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    9.unity资源商店"<<endl;//  https://assetstore.unity.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    10.unity官网"<<endl;//  https://unity.cn/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    11.Pycharm官网"<<endl;//  https://www.jetbrains.com/pycharm/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    12.阿里云官网"<<endl;
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    13.淘宝官网"<<endl;
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<endl<<endl;
			cout<<"请输入:";
			int s;
			cin>>s;
			if (s==1) system("start https://www.baidu.com");//直接打开 
			if (s==2) system("start https://github.com");
			if (s==3) system("start https://csdn.net");
			if (s==4) system("start http://www.vrcworld.com/");
			if (s==5) system("start https://www.iqiyi.com/");
			if (s==6) system("start https://www.youku.com/");
			if (s==7) system("start https://www.bilibili.com/");
			if (s==8) system("start https://www.luogu.com.cn/");
			if (s==9) system("start https://assetstore.unity.com/");
			if (s==10) system("start https://unity.cn/");
			if (s==11) system("start https://www.jetbrains.com/pycharm/");
			if (s==12) system("start https://www.aliyun.com/");
			if (s==13) system("start https://www.taobao.com/"); 
			system("cls");
			goto start;
		}
		if (ch=='3')
		{
			system("cls");
			for(int i=0;i<8;i++)cout<<endl;//行
			for(int i=0;i<25;i++)cout<<" ";
			cout<<"1.请问这个程序实用吗?A.很实用 B.还行 C.不实用 D.这作者这是做的什么玩意";
			cout<<endl<<"请输入:";
			char p[64],ch;
			int i=0;
			while (true)
			{
				ch=getch();//无回显的输入
				p[i++] = ch;
				if (ch=='\r'||ch=='\b')//getch()函数如果读到回车符号返回'/r'
				{
					p[i] = '\0';
					break;
				}
				putchar('A');
			}
			cout<<endl<<"感谢您的鼓励!";
			Sleep(1000);
			out("给你讲个故事");
			cout<<endl;
			out("有一天,你把 main.cpp里代码全部删掉,把我的代码复制进去------------------------------------");
			out("<<气岸头明>>");
			cout<<endl;
			out("呵呵呵...");
			Sleep(1000);
			system("cls");
			goto start;
		}
		return 0;
} 

 

Guess you like

Origin blog.csdn.net/m0_64036070/article/details/123600877
URL