Re: Connecting to a network share not working in a Windows Service
- From: "JohnFol" <OutlookExpress@xxxxxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 15:31:15 GMT
Good grief, not only did I write Windiows Wervice, but I cut'n'paste the
wrong API!
Appologies to all.
The Correct API is "WNetAddConnection2"
FYI I tried one of the other suggestions and set the project installer to
use NetworkService. On my PC this is great, but on a.n.other server (where I
log on as Admin to install) I get
"The account name is invalid or does not exist, or the password is invalid
for the account name specified."
Unless I can install it I cannot set the account under which it runs, soI'm
a bit stumped.
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:%230zylsiWFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx
>
> "JohnFol" <OutlookExpress@xxxxxxxxxxxxxxxx> wrote in message
> news:T62ie.5472$8K5.1477@xxxxxxxxxxxxxxxxxxxxxxx
>>I am using the Win23 API WNetCancelConnection2 and can sucessfully make a
>>connection to a share within my class. The class is called from a Windows
>>Form based test harness.
>>
>> When I instantiate exactly the samce class from a Windows Wervice, I get
>> "A specified logon session does not exist. It may already have been
>> terminated" . The error number is 1312.
>>
>> I know the code to be good, so I suspect something around security /
>> windows accounts etc.
>>
>> Any pointers?
>>
>>
>> (FYI I am using VB.Net and am an Admin on the machine)
>>
>
> Not sure what you intend to do with this "WNetCancelConnection2" call, you
> can only cancel connections running in the same logon session as the
> current session. Did you establish a network connection from within the
> service?
>
> Willy.
>
>
>
.
- Follow-Ups:
- Re: Connecting to a network share not working in a Windows Service
- From: Willy Denoyette [MVP]
- Re: Connecting to a network share not working in a Windows Service
- References:
- Connecting to a network share not working in a Windows Service
- From: JohnFol
- Re: Connecting to a network share not working in a Windows Service
- From: Willy Denoyette [MVP]
- Connecting to a network share not working in a Windows Service
- Prev by Date: Re: Connecting to a network share not working in a Windows Service
- Next by Date: RE: Is there a .NET equivalent to Component Categories
- Previous by thread: Re: Connecting to a network share not working in a Windows Service
- Next by thread: Re: Connecting to a network share not working in a Windows Service
- Index(es):
Relevant Pages
|