Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
File reading in C/C++/C# without the rights to it, how to do? - code-flow.club | Q&A

File reading in C/C++/C# without the rights to it, how to do?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
Want to read a file to which the current user does not have rights. Doing for example:


FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read);


Says access is denied. How to get around without reordering right?

Need an answer in C/C++ or C#, preferably on the sharp.
by | 11 views

3 Answers

0 like 0 dislike
Incorrect formulation of the question.
In short — no way.
If more detail:
1. the whole operation of any user program with file system through API functions of the operating system.
2. programming language (any) in this case, the only means of access to the data API funteam
3. file access is controlled by the operating system to the level of calling the API functions access the file.
4. so — no matter what language You are writing, if access is denied, then you won't get it.
The solutions to the problem:
. to change access rights to the file
b. to start the process with sufficient rights to access the file
by
0 like 0 dislike
To run the program under the correct user
Or give file privileges for the current user.
by
0 like 0 dislike
I do not understand the subject matter?
by

Related questions

0 like 0 dislike
7 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,181 users