Connecting Tech Pros Worldwide Forums | Help | Site Map

File Owner

=?Utf-8?B?Qkh6MDA=?=
Guest
 
Posts: n/a
#1: Nov 30 '07
I see that I can identify a files owner in windows explorer, hpw do I get
that information using VB.net

Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 30 '07

re: File Owner


"BHz00" <BHz00@discussions.microsoft.comschrieb:
Quote:
>I see that I can identify a files owner in windows explorer, hpw do I get
that information using VB.net
\\\
Imports System.IO
Imports System.Security.Principal
....
Dim Owner As String = _
File.GetAccessControl(<path>).GetOwner(GetType(NTA ccount)).Value
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Andrew Thompson
Guest
 
Posts: n/a
#3: Dec 4 '07

re: File Owner


On Dec 4, 8:34 pm, "Andrew Morton" <a...@in-press.co.uk.invalid>
wrote:
....
Quote:
(watch forline-wrap)
Here is a small tool designed to help higlight when lines will wrap.
<http://www.physci.org/twc.jnlp>

--
Andrew T.
PhySci.org
Andrew Morton
Guest
 
Posts: n/a
#4: Dec 5 '07

re: File Owner


BHz00 wrote:
Quote:
The function gives me a NullReferenceException was unhandled - Use the
"new" keyword to create an object instance when used in the following
code:
[Always] use Option Strict On at the top of your code - it will alert you to
problem areas.

For example, your sTotalSize variable should be an Int64 ("Long").

Andrew


Cor Ligthert[MVP]
Guest
 
Posts: n/a
#5: Dec 6 '07

re: File Owner


Andrew,
Quote:
>
[Always] use Option Strict On at the top of your code - it will alert you
to problem areas.
>
I am glad you wrote [Always] as you did, for learning the syntax it is not
bad to set it off, when your class is then as you think it can be, you can
set it to On. (And for your final version you have of course it forever to
ON)

Just to let people not think why was this in past not done by default (you
can set it as default in your options to). You know this of course, however
for others who read your message.

Cor

=?Utf-8?B?Qkh6MDA=?=
Guest
 
Posts: n/a
#6: Dec 11 '07

re: File Owner


Sorry about the wrap. I had the owner sort of working. I could get the owner
of a specific file, but not for every file in a directory. I then realized
that the files crashing the program give something that is not recognized as
a valid file owner. Is there a way figure this out before it causes the an
operating problem?

"Andrew Thompson" wrote:
Quote:
On Dec 4, 8:34 pm, "Andrew Morton" <a...@in-press.co.uk.invalid>
wrote:
....
Quote:
(watch forline-wrap)
>
Here is a small tool designed to help higlight when lines will wrap.
<http://www.physci.org/twc.jnlp>
>
--
Andrew T.
PhySci.org
>
Closed Thread


Similar Visual Basic .NET bytes