Click here to Skip to main content
14,303,783 members
   

C#

 
GeneralRe: Update User Environment Variable Pin
DavPCode2-Apr-19 12:07
memberDavPCode2-Apr-19 12:07 
QuestionValues Sum in a file Pin
Member 1420343029-Mar-19 10:46
memberMember 1420343029-Mar-19 10:46 
AnswerRe: Values Sum in a file Pin
OriginalGriff29-Mar-19 21:21
protectorOriginalGriff29-Mar-19 21:21 
AnswerRe: Values Sum in a file Pin
Member 1420343030-Mar-19 3:29
memberMember 1420343030-Mar-19 3:29 
AnswerRe: Values Sum in a file Pin
BillWoodruff31-Mar-19 19:25
mveBillWoodruff31-Mar-19 19:25 
QuestionSplit lines in a file Pin
Member 1420343029-Mar-19 8:34
memberMember 1420343029-Mar-19 8:34 
AnswerRe: Split lines in a file Pin
OriginalGriff29-Mar-19 9:11
protectorOriginalGriff29-Mar-19 9:11 
QuestionException while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 6:28
memberMember 1420343029-Mar-19 6:28 
Hello,
I'm trying to use an online compiler to do some operations in a file.
the line code:

string FlavorsFile= System.IO.File.ReadAllText(@"C:\Users\Public\FlavorsLines.txt");

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
   at System.Security.CodeAccessPermission.Demand()
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, AccessControlActions control, String[] fullPathList, Boolean checkForDuplicates, Boolean needFullPath)
   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.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at System.IO.File.ReadAllText(String path)
   at Rextester.Program.Main(String[] args)



Thanks
AnswerRe: Exception while trying reading a local file using online compiler Pin
OriginalGriff29-Mar-19 6:42
protectorOriginalGriff29-Mar-19 6:42 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 7:19
memberMember 1420343029-Mar-19 7:19 
GeneralRe: Exception while trying reading a local file using online compiler Pin
OriginalGriff29-Mar-19 7:23
protectorOriginalGriff29-Mar-19 7:23 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Dave Kreskowiak29-Mar-19 9:44
mveDave Kreskowiak29-Mar-19 9:44 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 10:48
memberMember 1420343029-Mar-19 10:48 
QuestionGetting exception message "Incorrect syntax near '(' " in C# web app Pin
Member 1420265628-Mar-19 20:10
memberMember 1420265628-Mar-19 20:10 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
GenJerDan28-Mar-19 20:58
memberGenJerDan28-Mar-19 20:58 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
OriginalGriff28-Mar-19 21:04
protectorOriginalGriff28-Mar-19 21:04 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
Luc Pattyn28-Mar-19 23:39
professionalLuc Pattyn28-Mar-19 23:39 
GeneralRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
OriginalGriff28-Mar-19 23:42
protectorOriginalGriff28-Mar-19 23:42 
GeneralRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
Luc Pattyn28-Mar-19 23:47
professionalLuc Pattyn28-Mar-19 23:47 
GeneralRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
GenJerDan29-Mar-19 1:39
memberGenJerDan29-Mar-19 1:39 
GeneralRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
Eddy Vluggen29-Mar-19 2:56
mveEddy Vluggen29-Mar-19 2:56 
QuestionDebugging + MSTest + Multiple Startup Project question Pin
Super Lloyd28-Mar-19 19:59
memberSuper Lloyd28-Mar-19 19:59 
AnswerRe: Debugging + MSTest + Multiple Startup Project question Pin
Super Lloyd1-Apr-19 14:04
memberSuper Lloyd1-Apr-19 14:04 
QuestionLooks like C# does not support Global Variables Pin
Brian_TheLion27-Mar-19 23:43
memberBrian_TheLion27-Mar-19 23:43 
AnswerRe: Looks like C# does not support Global Variables Pin
Richard MacCutchan27-Mar-19 23:46
protectorRichard MacCutchan27-Mar-19 23:46 

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.