Click here to Skip to main content
15,564,312 members
Home / Discussions / C#
   

C#

 
GeneralRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
pr1mem0ver7-Nov-20 14:25
pr1mem0ver7-Nov-20 14:25 
GeneralRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
Gerry Schmitz8-Nov-20 6:53
mveGerry Schmitz8-Nov-20 6:53 
GeneralRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
pr1mem0ver16-Nov-20 15:58
pr1mem0ver16-Nov-20 15:58 
AnswerRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
OriginalGriff8-Nov-20 2:35
mvaOriginalGriff8-Nov-20 2:35 
GeneralRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
pr1mem0ver16-Nov-20 16:10
pr1mem0ver16-Nov-20 16:10 
AnswerRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
Richard Deeming8-Nov-20 22:39
mveRichard Deeming8-Nov-20 22:39 
GeneralRe: Weird problem with Custom StreamReader with Read override not reading correct number of bytes during base method call Pin
pr1mem0ver16-Nov-20 16:06
pr1mem0ver16-Nov-20 16:06 
QuestionSystem.IO.File.WriteAllLines exception Pin
_Flaviu6-Nov-20 0:52
_Flaviu6-Nov-20 0:52 
I have compiled successfully a C# console project. And when I run this app is stopping at the line:

C#
System.IO.File.WriteAllLines(@destFile, elem);

where @destFile is

C#
string destFile


and elem is

C#
string[] elem = new string[...]


The error is:

System.UnauthorizedAccessException
  HResult=0x80070005
  Message=Access to the path 'e:\' is denied.
  Source=mscorlib
  StackTrace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
   at System.IO.File.WriteAllLines(String path, String[] contents)


Of course, I have ran this app as administrator rights, with the same results. What should I understand from this error ? And how can I solve it ? My C# knowledge is thin ...
AnswerRe: System.IO.File.WriteAllLines exception Pin
Richard MacCutchan6-Nov-20 1:01
mveRichard MacCutchan6-Nov-20 1:01 
AnswerRe: System.IO.File.WriteAllLines exception Pin
OriginalGriff6-Nov-20 1:18
mvaOriginalGriff6-Nov-20 1:18 
GeneralRe: System.IO.File.WriteAllLines exception Pin
_Flaviu6-Nov-20 3:33
_Flaviu6-Nov-20 3:33 
AnswerRe: System.IO.File.WriteAllLines exception Pin
Richard MacCutchan6-Nov-20 6:21
mveRichard MacCutchan6-Nov-20 6:21 
GeneralRe: System.IO.File.WriteAllLines exception Pin
_Flaviu7-Nov-20 22:08
_Flaviu7-Nov-20 22:08 
QuestionHow to extract part of HTML source? Pin
Member 5697394-Nov-20 8:53
Member 5697394-Nov-20 8:53 
AnswerRe: How to extract part of HTML source? Pin
OriginalGriff4-Nov-20 9:37
mvaOriginalGriff4-Nov-20 9:37 
GeneralRe: How to extract part of HTML source? Pin
Member 5697394-Nov-20 10:12
Member 5697394-Nov-20 10:12 
AnswerRe: How to extract part of HTML source? Pin
Richard Andrew x644-Nov-20 15:11
professionalRichard Andrew x644-Nov-20 15:11 
AnswerRe: How to extract part of HTML source? Pin
DerekT-P5-Nov-20 0:29
professionalDerekT-P5-Nov-20 0:29 
GeneralRe: How to extract part of HTML source? Pin
Richard Deeming5-Nov-20 0:36
mveRichard Deeming5-Nov-20 0:36 
GeneralRe: How to extract part of HTML source? Pin
DerekT-P5-Nov-20 1:26
professionalDerekT-P5-Nov-20 1:26 
GeneralRe: How to extract part of HTML source? Pin
Member 5697395-Nov-20 4:56
Member 5697395-Nov-20 4:56 
QuestionHow to switch the whole DataGridView Left-To-right? Pin
Alex Dunlop4-Nov-20 8:46
Alex Dunlop4-Nov-20 8:46 
AnswerRe: How to switch the whole DataGridView Left-To-right? Pin
BillWoodruff4-Nov-20 15:21
professionalBillWoodruff4-Nov-20 15:21 
AnswerRe: How to switch the whole DataGridView Left-To-right? Pin
Mycroft Holmes5-Nov-20 11:50
professionalMycroft Holmes5-Nov-20 11:50 
QuestionMoving VS 2019 solution from on-premise to cloud Pin
Member 144746074-Nov-20 8:27
Member 144746074-Nov-20 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.