添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Hey, am trying to connect remote on my laptops registry but I dosent work. I can connect but when I try to open a key to write I dont get any futher. Do some of you see the problem?
Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;
bool addReg(string sMachine, HKEY hDicRot, string server_path, string valPath, string valNamePath)
     HKEY hKey = NULL;
     HKEY hSourcesKey = NULL;
     LONG RegCon;
     char BackPath[MAX_PATH]; 
     strcpy(BackPath, valPath.c_str()); 
     RegCon = RegConnectRegistry(sMachine.c_str(), hDicRot, &hKey);
     if (RegCon == ERROR_SUCCESS)
                cout << "CON = OK" << endl;
                if (ERROR_SUCCESS == RegOpenKeyEx(hKey, server_path.c_str(),0,KEY_SET_VALUE,&hSourcesKey))
                    cout << "OPEN = OK" << endl;
                    if(RegSetValueEx(hSourcesKey,valNamePath.c_str(),0,REG_SZ,(const unsigned char*)BackPath,sizeof(BackPath)) == ERROR_SUCCESS)
                               cout << "REG ADD = OK" << endl;
                               cout << "REG ADD = FALSE" << endl;
                    cout << "OPEN = FALSE" << endl;
         cout << "CON = FALSE" << endl;
     return true;
int main(int argc, char *argv[])
    if(addReg("\\\\127.0.0.1", HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "Test", "TEST") == true)
                             cout << "done" << endl;
    system("pause");
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform. * Porting from Android to Windows 8: The Real Story
Do you have an Android application? How hard would it really be to port to Windows 8? * Guide to Porting Android Applications to Windows 8
If you've already built for Android, learn what do you really need to know to port your application to Windows Phone 8. * HTML5 Development Center
Our portal for articles, videos, and news on HTML5, CSS3, and JavaScript * Windows App Gallery
See the Windows 8.x apps we've spotlighted or submit your own app to the gallery! Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.