Access denied in webservice

I have winforms and it connects wit webservice.

Webservice has a method that creates a folder.

Directory.Create(path);

Webservice is located on the company’s server, and I must create this folder on a different drive in the company.

When I call this method, I get an exception "Access denied to path..."

When the webservice worked on my computer, everything was in order.

I have full access to this network drive.

But how to establish full access to the server of my company?

When I check this method:

[WebMethod]
        public string GetNameOfUser()
        {
            return WindowsIdentity.GetCurrent().Name;
        }

I get <string>NT AUTHORITY\NETWORK SERVICE</string>

Other web methods without proper directory instructions

Edited Structure

Computer A is in the domain and there are running forms of winning

Server A: running webservice

Network drive: there are folders with important files for the winforms application

Yes, we have a domain. Computer A has access to a network drive.

+3
2

, , , -.

- NT AUTHORITY\NETWORK SERVICE. , , , , .

- , :

  • , .
  • -

- .

+2

- , , .

. , .

0

Source: https://habr.com/ru/post/1736825/


All Articles