×

域名重定向 重定向

域名被重定向?在windows下如何实现重定向

admin admin 发表于2022-07-10 07:22:40 浏览95 评论0

抢沙发发表评论

域名被重定向


域名重定向分为301和302,301是永久,302是暂时使用重定向说明该页面或者是域名已经或者暂时停止使用,将被转到一个新的页面当中,其PR等信息也会转移

在windows下如何实现重定向


#include 《Windows.h》
#include 《stdio.h》

void main()
{
SECURITY_ATTRIBUTES sa,sa2;
HANDLE hInputRead,hInputWrite;
HANDLE hOutputRead,hOutputWrite;

sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
if (!CreatePipe(&hOutputRead,&hOutputWrite,&sa,0))
{
printf(“Error On CreatePipe1“);
return;
}

sa2.nLength = sizeof(SECURITY_ATTRIBUTES);
sa2.lpSecurityDescriptor = NULL;
sa2.bInheritHandle = TRUE;
if (!CreatePipe(&hInputRead,&hInputWrite,&sa2,0))
{
printf(“Error On CreatePipe2“);
return;
}

STARTUPINFO si;
PROCESS_INFORMATION pi;
si.cb = sizeof(STARTUPINFO);
GetStartupInfo(&si);
si.hStdError = hOutputWrite;
si.hStdOutput = hOutputWrite;
si.hStdInput = hInputRead;
si.wShowWindow = SW_HIDE;
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;

DWORD dwWritten;
if (!CreateProcess(NULL,“E:\\and.exe“,NULL,NULL,TRUE,NULL,NULL,NULL,&si,π))
{
printf(“Error On CreateProcess“);
return;
}

CloseHandle(hInputRead);
CloseHandle(hOutputWrite);

char szInPut = “12\r\n 34\r\n“;
WriteFile(hInputWrite, szInPut, strlen(szInPut), &dwWritten, NULL);

char buffer = {0};
DWORD bytesRead;
while (true)
{
if(ReadFile(hOutputRead,buffer,4095,&bytesRead,NULL) == NULL)
{
break;
}

printf(buffer);
Sleep(500);
}
CloseHandle(hInputWrite);
CloseHandle(hOutputRead);
}

/*and.exe的

#include 《stdio.h》

void main()
{
int x,y;
printf(“Input First Num:\r\n“);
scanf( “%d“, &x );
printf(“Input Second Num:\r\n“);
scanf( “%d“, &y );

printf(“%d + %d = %d\r\n“,x,y,x+y);
}

*/

域名重定向怎么解决


1、如果是打开网上的某站点浏览器提示“域名重定向”,一般来说都是系统文件“hosts”被破坏了,只要删除里面的内容或者修复hosts文件就能解决问题。

2、打开电脑,输入路径:C:\Windows\System32\drivers\etc 找到hosts文件。右键点击该文件,选择“打开”,利用记事本打开文件。然后,把里面所有的内容都删除。再打开该网站站点看看是否已经正常了!

3、如果以上操作不行,就利用360安全卫士或借助其他工具修复IE、修复系统文件。选择系统修复-》常规修复。一般问题都能解决。
-域名重定向