Click here to Skip to main content
15,887,444 members
Home / Discussions / C#
   

C#

 
AnswerRe: TextBox Validation Pin
Rupesh Kumar Swami1-Sep-07 4:24
Rupesh Kumar Swami1-Sep-07 4:24 
Questionhow to read evc++ dll using c# .net 1.0 Pin
mercenary011-Sep-07 2:24
mercenary011-Sep-07 2:24 
AnswerRe: how to read evc++ dll using c# .net 1.0 Pin
Vasudevan Deepak Kumar1-Sep-07 2:26
Vasudevan Deepak Kumar1-Sep-07 2:26 
GeneralRe: how to read evc++ dll using c# .net 1.0 Pin
mercenary011-Sep-07 2:29
mercenary011-Sep-07 2:29 
GeneralRe: how to read evc++ dll using c# .net 1.0 Pin
Vasudevan Deepak Kumar1-Sep-07 2:30
Vasudevan Deepak Kumar1-Sep-07 2:30 
Questionhow to open .csproj in xml file through C# code and add a file as a link [modified] Pin
Situ141-Sep-07 2:20
Situ141-Sep-07 2:20 
AnswerRe: how to open .csproj in xml file through C# code and add a file as a link Pin
Vasudevan Deepak Kumar1-Sep-07 2:27
Vasudevan Deepak Kumar1-Sep-07 2:27 
QuestionWMI for Remote System Pin
Joe Rozario1-Sep-07 2:12
Joe Rozario1-Sep-07 2:12 
Dear friends,

I have Created a windows Service in .net 2005 to find the WMI Classes that are available in a system.

When I invoke this windows service through a web site

I could get all the WMI Classes available in my system.
But it throws an error “Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) “ Like this for the remote System.


Note: I have given the correct User name and Password.

And this same code works fine in windows application,console application and web site for the remote system and local system..


This is the Code:

private string[] GetClassesList(string sIPAddress, string sWMINameSpace, string sUserName, string sPassword, bool bRemoteSystem)
{

int queryClassCount = 0;
string[] aClassList = null;
ConnectionOptions cnnOptions = new ConnectionOptions();
ManagementObjectCollection objClassColl = null;
cnnOptions.Username = sUserName;
cnnOptions.Password = sPassword;
cnnOptions.Authentication = AuthenticationLevel.Packet;
ManagementObjectSearcher searcher = null;
try
{
if (bRemoteSystem)
{
searcher = new ManagementObjectSearcher(new ManagementScope(@"\\" + sIPAddress + @"\" + sWMINameSpace, cnnOptions),

new WqlObjectQuery("select * from meta_class"), null);
}
else
{
searcher = new ManagementObjectSearcher(new ManagementScope(sWMINameSpace),
new WqlObjectQuery("select * from meta_class"), null);
}

objClassColl = searcher.Get();
//aClassList = new string[objClassColl.Count+1];
}
catch (Exception me)
{
MessageBox.Show(me.Message);
}



Friends, Is there any problem in my code?

Any idea’s or Link

Help me

Thank u.

by
Joe


AnswerRe: WMI for Remote System Pin
Vasudevan Deepak Kumar1-Sep-07 2:31
Vasudevan Deepak Kumar1-Sep-07 2:31 
GeneralRe: WMI for Remote System Pin
Joe Rozario1-Sep-07 4:59
Joe Rozario1-Sep-07 4:59 
AnswerRe: WMI for Remote System Pin
Amit Kumar G2-Sep-07 9:05
Amit Kumar G2-Sep-07 9:05 
GeneralRe: WMI for Remote System Pin
Joe Rozario2-Sep-07 18:07
Joe Rozario2-Sep-07 18:07 
QuestionDate converstion to string Pin
kankeyan1-Sep-07 1:50
kankeyan1-Sep-07 1:50 
AnswerRe: Date converstion to string Pin
George L. Jackson1-Sep-07 2:22
George L. Jackson1-Sep-07 2:22 
QuestionC# Basic Pin
Bhavesh Bagadiya1-Sep-07 1:21
Bhavesh Bagadiya1-Sep-07 1:21 
AnswerRe: C# Basic Pin
Vasudevan Deepak Kumar1-Sep-07 1:34
Vasudevan Deepak Kumar1-Sep-07 1:34 
AnswerRe: C# Basic Pin
Muammar©1-Sep-07 1:51
Muammar©1-Sep-07 1:51 
AnswerRe: C# Basic Pin
Guffa1-Sep-07 2:32
Guffa1-Sep-07 2:32 
GeneralRe: C# Basic Pin
XFighter1-Sep-07 6:21
XFighter1-Sep-07 6:21 
GeneralRe: C# Basic Pin
Guffa1-Sep-07 9:05
Guffa1-Sep-07 9:05 
QuestionSimulated mouse clicks Pin
Opa Knack1-Sep-07 1:10
Opa Knack1-Sep-07 1:10 
AnswerRe: Simulated mouse clicks Pin
Vasudevan Deepak Kumar1-Sep-07 1:35
Vasudevan Deepak Kumar1-Sep-07 1:35 
AnswerRe: Simulated mouse clicks Pin
Kristian Sixhøj2-Sep-07 8:41
Kristian Sixhøj2-Sep-07 8:41 
Questionuser control grid with dropdown Pin
dsaikrishna1-Sep-07 0:53
dsaikrishna1-Sep-07 0:53 
QuestionForms and Data please help. Pin
XFighter1-Sep-07 0:44
XFighter1-Sep-07 0:44 

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.