void __fastcall TfrmMainForm::WriteToMyRegistry(int table_count) { //TODO: Add your source code here TRegistry *MyRegistry=new TRegistry; MyRegistry->RootKey=HKEY_LOCAL_MACHINE; //改變?nèi)笔ootkey if(!MyRegistry->OpenKey("Software\Microsoft\Windows\CurrentVersion\Run",true)) //打開(kāi)主鍵 //這樣雙引號(hào)里面的東西就變成了CurrentKey { Application->MessageBox("注冊(cè)表內(nèi)容無(wú)效", "讀取注冊(cè)表出錯(cuò)",MB_ICONERROR); MyRegistry->CloseKey(); delete MyRegistry; return; } MyRegistry->WriteString("myrun","c:\sthvcd\sthvcd.exe"); MyRegistry->CloseKey(); delete MyRegistry; |
聯(lián)系客服