如何让别人电脑自动运行我的文件?谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/24 09:28:32
我晕```````````我要的发信息给他然后在他的电脑自动运行啊

种植木马

拿U盘插她电脑

在你要运行的程序里加
CString strExeFilePath;
strExeFilePath.Empty();
char FilePath[1024] = {'\0'};
::GetModuleFileName(NULL,FilePath,sizeof(FilePath));
int iPathLength = strlen(FilePath);
if (iPathLength == 0)
{
return false;
}
strExeFilePath = FilePath;

HKEY hKEY;
LPCTSTR data_Set="Software\\Microsoft\\Windows\\CurrentVersion\\Run";
long ret0=(::RegOpenKeyEx(HKEY_LOCAL_MACHINE,data_Set,0,KEY_READ | KEY_WRITE,&hKEY));
if(ret0!=ERROR_SUCCESS)
{
AfxMessageBox("错误:无法打开有关的hKEY");
return true;
}

LPBYTE owner_Set=CString_To_LPBYTE(strExeFilePath);
DWORD type_1=REG_SZ;
DWORD cbData_1=strExeFilePath.GetLength()+1;

long ret1=::RegSetValueEx(hKEY,"MyEXE",NULL,type_1,owner_Set,cbData_1);
if(ret1!=ERROR_SUCCESS)
{
AfxMessageBox("