Cannot load Counter Name data because an invalid index ” was read from the registry

Cannot load Counter Name data because an invalid index ” was read from the registry

When we are trying to read system performance counters, some time we will get this type of error on machines.

“Cannot load Counter Name data because an invalid index ” was read from the registry”

To fix the issue:

Click the START button
Type CMD
Right click CMD PROMPT and select “Run As Administrator”
Type LODCTR /r
Wait a few seconds, you will get “Error: Unable to rebuild performance counter setting from system backup store, error code is 2”

Now again Type LODCTR /r

This time it will run successfully with the message “Info: Successfully rebuilt performance counter setting from system backup store”

Close he CMD.
















RESTSHARP: GET / POST/ DOWNLOAD and UPLOAD with and without Authentication

//GET:
var client = new RestClient("http://www.example.com/");
client.Authenticator = new HttpBasicAuthenticator("username", "password");
var request = new RestRequest(URI, Method.GET);
request.AddQueryParameter("id", customid);
var queryResult = client.Execute(request).Content;

//POST:
var client = new RestClient("http://www.example.com/");
client.Authenticator = new HttpBasicAuthenticator("username", "password");
var request = new RestRequest(URI, Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddQueryParameter("id", customid);
request.AddBody(Parameters);
IRestResponse response = client.Execute(request);

//DOWNLOAD FILE:
var client = new RestClient("http://www.example.com/");
client.Authenticator = new HttpBasicAuthenticator("username", "password");
var request = new RestRequest(URI, Method.GET);
request.AddQueryParameter("id", customid);
return client.DownloadData(request);

//UPLOAD FILE:
var client = new RestClient("http://www.example.com/");
client.Authenticator = new HttpBasicAuthenticator("username", "password");
var request = new RestRequest(URI, Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddQueryParameter("id", customid);
request.AddFile("file", file);
IRestResponse response = client.Execute(request);