| |

VerySource

 Forgot password?
 Register
Search
View: 760|Reply: 7

How to set folder permissions

[Copy link]

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-6 23:00:02
| Show all posts |Read mode
Dear teachers,
How can I control the permissions of a folder through an ASP.NET program? How can such code be written?
Waiting online!
Reply

Use magic Report

0

Threads

8

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-24 20:30:01
| Show all posts
Learned, I don't know if it is possible;
But the general program only considers the access rights
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-24 23:00:01
| Show all posts
Are there any examples?
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-5-25 22:00:02
| Show all posts
--b
The permissions of asp.net are only equivalent to that of the guest user.
To allow asp.net to control the permissions of the folder, at least the windows account permission level of asp.net should reach the system or administrator level.
Forget it, simply write a line of code to format the hard drive.

The security policy is not to allow asp.net to operate (configure) the permissions of the disk system. Only the permissions granted can be used.
Otherwise, the web hosting will have collapsed long ago
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-27 10:00:01
| Show all posts
Then asp.net calls the dos command to set the folder permissions, okay?
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-5-29 11:30:03
| Show all posts
Should not work, no permission to change the local user
Reply

Use magic Report

0

Threads

15

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-5-29 18:30:02
| Show all posts
asp.net can't do any unauthorized operation on the client, otherwise how to protect their computer security
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-30 17:45:01
| Show all posts
string commandText = "cacls c: / g everyone: f"
                           Process p = new Process ();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
try
{
p.Start ();
p.StandardInput.WriteLine (commandText);
p.StandardInput.WriteLine ("exit");
strOutput = p.StandardOutput.ReadToEnd ();
p.WaitForExit ();
p.Close ();
}
catch (Exception e)
{
strOutput = e.Message;
return
}
I don't know if this is appropriate
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