| |

VerySource

 Forgot password?
 Register
Search
View: 1640|Reply: 12

How to ask ASP.NET to access files shared by other computers

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-6 20:20:01
| Show all posts |Read mode
In ASP.NET


[Server A] Web server 192.168.0.1

[Server B] FTP file server 192.168.0.2

How to list and read files uploaded by users in B?

I've tried using\\192.168.0.2\abc\def.txt to not open the file!
Probably because of the ASPNET user name permissions problem ... don't understand ...

Looking forward to expert answers ...
Reply

Use magic Report

0

Threads

11

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 United States

Post time: 2020-1-6 20:21:01
| Show all posts
Friendly Bangding
Reply

Use magic Report

2

Threads

13

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-7 11:57:01
| Show all posts
I tried to open the file with\\192.168.0.2\abc\def.txt
You are accessing the FTP service of the B server, and it has nothing to do with the asp.net user permissions. You try to set the FTP directory to be fully shared.
Reply

Use magic Report

0

Threads

8

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-7 18:00:01
| Show all posts
Paste the code of your open file
Also posted the reported exception
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-7 18:09:01
| Show all posts
Put\\192.168.0.2\abc\
NTFS permissions for this directory are set to allow everyone access, so are the share permissions
Reply

Use magic Report

0

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-7 18:27:01
| Show all posts
up
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-7 19:27:01
| Show all posts
You cannot open the file with\\192.168.0.2\abc\def.txt
The reason is that there is no permission added, this should be accessible as per what I said above.

But how do you access it in the code? Best post code to see
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-8 02:00:02
| Show all posts
Set everyone
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 France

Post time: 2020-1-8 09:36:01
| Show all posts
Use identity impersonation on a server at 192.168.0.1.
If you use A account password 123


Then create the same account, same password in 192.168.0.2, and have corresponding permissions on the folder.

Then you can access\\192.168.0.2\abc\def.txt like you would access a local file.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-22 23:54:01
| Show all posts
With the simplest test,
For example, write a probe file in C # to detect the existence of System.IO.File.Exist (filename),
Or create a folder CreateDirectory (dir_name); ...
Written in C #
Probe\\192.168.0.2\abc\def.txt
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list