Click here to Skip to main content
15,923,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: Parsing LPSAFEARRAY from C++ Pin
alispas2-Sep-07 6:41
alispas2-Sep-07 6:41 
QuestionDeleting specific lines of a text file Pin
XFighter1-Sep-07 5:35
XFighter1-Sep-07 5:35 
AnswerRe: Deleting specific lines of a text file Pin
Colin Angus Mackay1-Sep-07 5:53
Colin Angus Mackay1-Sep-07 5:53 
GeneralRe: Deleting specific lines of a text file Pin
XFighter1-Sep-07 6:16
XFighter1-Sep-07 6:16 
GeneralRe: Deleting specific lines of a text file Pin
Colin Angus Mackay1-Sep-07 6:19
Colin Angus Mackay1-Sep-07 6:19 
GeneralRe: Deleting specific lines of a text file Pin
Christian Graus1-Sep-07 13:17
protectorChristian Graus1-Sep-07 13:17 
AnswerRe: Deleting specific lines of a text file Pin
Vasudevan Deepak Kumar1-Sep-07 23:03
Vasudevan Deepak Kumar1-Sep-07 23:03 
QuestionMATLAB TO C# Pin
SANA20861-Sep-07 5:04
SANA20861-Sep-07 5:04 
AnswerRe: MATLAB TO C# Pin
Ed.Poore1-Sep-07 8:29
Ed.Poore1-Sep-07 8:29 
AnswerRe: MATLAB TO C# Pin
pmarfleet1-Sep-07 8:39
pmarfleet1-Sep-07 8:39 
AnswerRe: MATLAB TO C# Pin
Vasudevan Deepak Kumar1-Sep-07 22:58
Vasudevan Deepak Kumar1-Sep-07 22:58 
QuestionMATLAB TO C# Pin
SANA20861-Sep-07 5:02
SANA20861-Sep-07 5:02 
AnswerRe: MATLAB TO C# Pin
_beginner_1-Sep-07 8:28
_beginner_1-Sep-07 8:28 
AnswerRe: MATLAB TO C# Pin
Christian Graus1-Sep-07 13:15
protectorChristian Graus1-Sep-07 13:15 
AnswerRe: MATLAB TO C# Pin
Vasudevan Deepak Kumar1-Sep-07 22:59
Vasudevan Deepak Kumar1-Sep-07 22:59 
QuestionTextBox Validation Pin
Assaf821-Sep-07 3:31
Assaf821-Sep-07 3:31 
AnswerRe: TextBox Validation Pin
pmarfleet1-Sep-07 4:11
pmarfleet1-Sep-07 4:11 
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


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.