Click here to Skip to main content
14,333,745 members
   

C#

 
GeneralRe: Resize controls at runtime (borderless form) Pin
Member 1407482711-Oct-19 2:25
memberMember 1407482711-Oct-19 2:25 
GeneralRe: Resize controls at runtime (borderless form) Pin
Eddy Vluggen11-Oct-19 2:29
mveEddy Vluggen11-Oct-19 2:29 
GeneralRe: Resize controls at runtime (borderless form) Pin
Rob Philpott11-Oct-19 3:03
memberRob Philpott11-Oct-19 3:03 
GeneralRe: Resize controls at runtime (borderless form) Pin
Eddy Vluggen11-Oct-19 3:07
mveEddy Vluggen11-Oct-19 3:07 
AnswerRe: Resize controls at runtime (borderless form) Pin
BillWoodruff13hrs 20mins ago
mveBillWoodruff13hrs 20mins ago 
Question2D Arrays Pin
LilJokez_Gaming10-Oct-19 11:27
memberLilJokez_Gaming10-Oct-19 11:27 
AnswerRe: 2D Arrays Pin
Luc Pattyn10-Oct-19 13:11
professionalLuc Pattyn10-Oct-19 13:11 
QuestionHelp with WMI Connect Remotely Pin
mniceguy819-Oct-19 4:30
membermniceguy819-Oct-19 4:30 
Dear CodeProject members,

Hope you can help with the second code that i'm struggling as the other one was answered.

I'm new to C# and compiled this code but I'm stuck and getting error Argument 1: cannot convert from 'System.Management.MamangementScope' to 'string' which is in bold and underlined below

my references are

using System;
using System.Linq;
using System.Management;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;

private void WMI_Click(object sender, EventArgs e)

ManagementObjectSearcher objSearcher = null;
ManagementObjectCollection objCollection = null;
ManagementScope objScope = null;
ManagementQuery objQuery = null;
ConnectionOptions objOptions = null;

objOptions = new ConnectionOptions();
objOptions.Impersonation = ImpersonationLevel.Impersonate;
//options.Username = "Username";
//options.Password = "Password";
//options.Authority = "NTLMDOMAIN:DOMAIN";

objScope = new ManagementScope("\\\\Computer\\root\\cimv2:", objOptions);
objScope.Connect();

objQuery = new ObjectQuery("SELECT * FROM Win32_PnPEntity");

objSearcher = new ManagementObjectSearcher(objScope, objQuery);

objCollection = objSearcher.Get();

//objQuery = new ManagementQuery ("SELECT * FROM Win32_PnPEntity");


Thank you and much appreciate your help.
AnswerRe: Help with WMI Connect Remotely Pin
Dave Kreskowiak9-Oct-19 6:47
mveDave Kreskowiak9-Oct-19 6:47 
GeneralRe: Help with WMI Connect Remotely Pin
mniceguy819-Oct-19 22:28
membermniceguy819-Oct-19 22:28 
AnswerRe: Help with WMI Connect Remotely Pin
Richard MacCutchan9-Oct-19 8:51
protectorRichard MacCutchan9-Oct-19 8:51 
GeneralRe: Help with WMI Connect Remotely Pin
Dave Kreskowiak9-Oct-19 9:09
mveDave Kreskowiak9-Oct-19 9:09 
GeneralRe: Help with WMI Connect Remotely Pin
mniceguy819-Oct-19 9:26
membermniceguy819-Oct-19 9:26 
AnswerRe: Help with WMI Connect Remotely Pin
OriginalGriff9-Oct-19 9:37
protectorOriginalGriff9-Oct-19 9:37 
GeneralRe: Help with WMI Connect Remotely Pin
mniceguy819-Oct-19 9:40
membermniceguy819-Oct-19 9:40 
QuestionSimple API to record AVI Files Pin
TyrionTheImp9-Oct-19 2:03
memberTyrionTheImp9-Oct-19 2:03 
AnswerRe: Simple API to record AVI Files Pin
Richard MacCutchan9-Oct-19 2:49
protectorRichard MacCutchan9-Oct-19 2:49 
QuestionWhy is the dataGridView1_SortCompare function not working ? Pin
Member 24584678-Oct-19 23:29
memberMember 24584678-Oct-19 23:29 
QuestionRe: Why is the dataGridView1_SortCompare function not working ? Pin
Richard MacCutchan8-Oct-19 23:37
protectorRichard MacCutchan8-Oct-19 23:37 
AnswerRe: Why is the dataGridView1_SortCompare function not working ? Pin
Member 24584679-Oct-19 15:20
memberMember 24584679-Oct-19 15:20 
GeneralRe: Why is the dataGridView1_SortCompare function not working ? Pin
Richard MacCutchan9-Oct-19 21:38
protectorRichard MacCutchan9-Oct-19 21:38 
GeneralRe: Why is the dataGridView1_SortCompare function not working ? Pin
Member 245846710-Oct-19 18:17
memberMember 245846710-Oct-19 18:17 
GeneralRe: Why is the dataGridView1_SortCompare function not working ? Pin
Richard MacCutchan10-Oct-19 22:03
protectorRichard MacCutchan10-Oct-19 22:03 
GeneralRe: Why is the dataGridView1_SortCompare function not working ? Pin
Member 245846714-Oct-19 20:52
memberMember 245846714-Oct-19 20:52 
GeneralRe: Why is the dataGridView1_SortCompare function not working ? Pin
Richard MacCutchan14-Oct-19 22:00
protectorRichard MacCutchan14-Oct-19 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.