System.Management?

  • Thread starter Thread starter Roberto Carcione
  • Start date Start date
R

Roberto Carcione

Hi at all,

i had installed vsnet2003 architect with new framework 1.1. Actually i'm
making a very simple project, where i use the File class to copy a file, but
when i tried to copy the framework have generated an exception
"unauthorizedaccessexception" so I tried to use using system.management but
the compiler said me it didn't find it. In fact i didn't see it with object
browser....under system there isn't management namespace....

what it is my problem? Do not i have the correct framework?

roberto
 
system has a sub namespace called Management but you must add a reference to
that library (you may see it under [WindowsFolder]\Assembly directory - GAC)
in order to use that namespace...

and also do not foget that C# is case sensitive.... ;)
 
Hi Murat,
thanks a lot for you help...but do you know wich assemply, pls?


roberto


Murat Karatutlu said:
system has a sub namespace called Management but you must add a reference to
that library (you may see it under [WindowsFolder]\Assembly directory - GAC)
in order to use that namespace...

and also do not foget that C# is case sensitive.... ;)



Roberto Carcione said:
Hi at all,

i had installed vsnet2003 architect with new framework 1.1. Actually i'm
making a very simple project, where i use the File class to copy a file,
but
when i tried to copy the framework have generated an exception
"unauthorizedaccessexception" so I tried to use using system.management
but
the compiler said me it didn't find it. In fact i didn't see it with
object
browser....under system there isn't management namespace....

what it is my problem? Do not i have the correct framework?

roberto
 
Hi Roberto,

what do try to copy? the .net framework files ??
Your exception simply say that it is a read resp.
write or an security problem.
Try out if your app can copy a simply textfile.
If this is successfully, everything is fine and it
will copy every other file that is not restricted.

Cheers
Lars Behrmann

_________________
Nothing is impossible. UML is the key for all your problems.
AODL - Make your .net apps OpenOffice ready
http://aodl.sourceforge.net/
 
System.Management.dll

in VS environment click "Add Reference" and choose "System.Management" from
the listbox in the .NET tab


Roberto Carcione said:
Hi Murat,
thanks a lot for you help...but do you know wich assemply, pls?


roberto


Murat Karatutlu said:
system has a sub namespace called Management but you must add a reference to
that library (you may see it under [WindowsFolder]\Assembly directory - GAC)
in order to use that namespace...

and also do not foget that C# is case sensitive.... ;)



Roberto Carcione said:
Hi at all,

i had installed vsnet2003 architect with new framework 1.1. Actually
i'm
making a very simple project, where i use the File class to copy a
file,
but
when i tried to copy the framework have generated an exception
"unauthorizedaccessexception" so I tried to use using system.management
but
the compiler said me it didn't find it. In fact i didn't see it with
object
browser....under system there isn't management namespace....

what it is my problem? Do not i have the correct framework?

roberto
 
Hi Murat, Hi Lars,

the references was included and now i see the system.management namespace.
But now the problem is: before I tried to copy a file File.Copy (..) from my
local computer to another disk on another computer from my webapplication
(the simple application :)). This make the exception i said before
"unauthorizedaccessexception", so i tried to use ManagementScope to give the
credentials (user login and password, i saw it from msdn) and i tried to
connect and seems it's ok (no exception was generated) (the path i give to
the constructor of the ManagemenScope is
\\\\MyServer\\MyNamespace:Win32_Logicaldisk='c:'). And after i used the File
class to copy a local file to the remote disk but i don't know exactly where
i make the mistake...i don't know how can i do the relation between
ManagementScope variable and File class variable, How they link together?
and is it right to use ManagementScope to do what i want to do?
My computer and destination computer are in the same lan under the same
workgroup.

thank you very much.

roberto


Murat Karatutlu said:
System.Management.dll

in VS environment click "Add Reference" and choose "System.Management" from
the listbox in the .NET tab


Roberto Carcione said:
Hi Murat,
thanks a lot for you help...but do you know wich assemply, pls?


roberto


Murat Karatutlu said:
system has a sub namespace called Management but you must add a
reference
to
that library (you may see it under [WindowsFolder]\Assembly directory - GAC)
in order to use that namespace...

and also do not foget that C# is case sensitive.... ;)



Hi at all,

i had installed vsnet2003 architect with new framework 1.1. Actually
i'm
making a very simple project, where i use the File class to copy a
file,
but
when i tried to copy the framework have generated an exception
"unauthorizedaccessexception" so I tried to use using system.management
but
the compiler said me it didn't find it. In fact i didn't see it with
object
browser....under system there isn't management namespace....

what it is my problem? Do not i have the correct framework?

roberto
 
i think you want to copy some file across computers and tis process runs
behind a web application. If your users have the right to copy that file add
these lines to your web.config and you may do it with File.Copy(...)

web.config

<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true" />

Roberto Carcione said:
Hi Murat, Hi Lars,

the references was included and now i see the system.management namespace.
But now the problem is: before I tried to copy a file File.Copy (..) from
my
local computer to another disk on another computer from my webapplication
(the simple application :)). This make the exception i said before
"unauthorizedaccessexception", so i tried to use ManagementScope to give
the
credentials (user login and password, i saw it from msdn) and i tried to
connect and seems it's ok (no exception was generated) (the path i give to
the constructor of the ManagemenScope is
\\\\MyServer\\MyNamespace:Win32_Logicaldisk='c:'). And after i used the
File
class to copy a local file to the remote disk but i don't know exactly
where
i make the mistake...i don't know how can i do the relation between
ManagementScope variable and File class variable, How they link together?
and is it right to use ManagementScope to do what i want to do?
My computer and destination computer are in the same lan under the same
workgroup.

thank you very much.

roberto


Murat Karatutlu said:
System.Management.dll

in VS environment click "Add Reference" and choose "System.Management" from
the listbox in the .NET tab


Roberto Carcione said:
Hi Murat,
thanks a lot for you help...but do you know wich assemply, pls?


roberto


system has a sub namespace called Management but you must add a reference
to
that library (you may see it under [WindowsFolder]\Assembly
directory -
GAC)
in order to use that namespace...

and also do not foget that C# is case sensitive.... ;)



Hi at all,

i had installed vsnet2003 architect with new framework 1.1. Actually
i'm
making a very simple project, where i use the File class to copy a
file,
but
when i tried to copy the framework have generated an exception
"unauthorizedaccessexception" so I tried to use using system.management
but
the compiler said me it didn't find it. In fact i didn't see it with
object
browser....under system there isn't management namespace....

what it is my problem? Do not i have the correct framework?

roberto
 
Back
Top