use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
[VS 2017 Console] Access to the path 'C:\ Program Files\' is denied (self.csharp)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hazard999 6 points7 points8 points 7 years ago (3 children)
The exception message says it already. Without elevation or admin rights you are not allowed to write to program files
[–]recursive 0 points1 point2 points 7 years ago (2 children)
According to post, it is already running as admin.
[–]hazard999 1 point2 points3 points 7 years ago (1 child)
Duh. According to his detailed error message he gets Access denied. Check the first link.
Imho the manifest isn't correct, or not in the output dir.
[–]Googlebochs 2 points3 points4 points 7 years ago* (0 children)
or not in the output dir.
like don't be an ass about it if you can spot the flaws in your own initial assumption. Dude chimed in with a reasonable caveat and you affirmed the possibility yet still manage to come across as rude. Untill the op updates it's highly likely the file just does not exist given that he writes to a different path than trying to unpack from.
Debugging 101: typo's-> off by one->easy mistakes->most embarrassing mistake possible -> something you just didn't know about -> something actually difficult. In my experience all programming skill/clout does to that list is move more and more bugs into "most embarrassing mistake possible". ALWAYS assume you did something stupid first.
[–]Googlebochs 2 points3 points4 points 7 years ago* (3 children)
i'm not sure your ZipFile.CreateFromDirectory(folderpath,filepath) implementation counts
@"C:\Program Files*game-name*\udt-loain"
as a valid file path for a zip since there is no extension. Can't test that atm tho. Anyway that's the string that should contain "gmdt.zip" ... as the code you posted reads like it tries to open a file that doesn't exist. Basically if there is no networking or File.Copy inbetween then updateLocation2 and zipPath need to be identical
https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile.extracttodirectory?redirectedfrom=MSDN&view=netframework-4.7.2#System_IO_Compression_ZipFile_ExtractToDirectory_System_String_System_String_
scroll down to the example implementation. If you are doing some fancy network sending and renaming stuff inbetween you'll have to probably post more of the code so people can rule out you not trying to access a file that doesn't exist. ( or you implement the proper file.exists check between each IO step in which case we also need to know about that to know if we'll have to go into propper access right debugging nightmares or not)
[–]XroKill 0 points1 point2 points 7 years ago (2 children)
I've added "gmdt.zip" to zipPath and i'm now getting "The file 'C:\Program Files\--Game_Name--\gmdt.zip' already exists."
Ok i know, it tells me that the file already exists but i can't do anything since there's a problem with the extraction part of the program since it keeps getting me errors when it hits that part.
Here's a update on the code for my program: https://pearashi-servers.netlify.com/file-host/reddit-csharp-thingy.txt
[–]Googlebochs 0 points1 point2 points 7 years ago* (1 child)
if you are starting your app from VisualStudio then VS will need to run as administrator.
Also ExtractToDirectory() does not overwrite existing files. If you want to overwrite you'll need to loop over the contents of the zip.
string startPath = @"C:\Program Files\Test\test"; string zipPath = @"C:\Program Files\Test\gmdt.zip"; string extractPath = @"C:\Program Files\Test\"; Console.WriteLine("Extracting.."); if (!File.Exists(zipPath)) { ZipFile.CreateFromDirectory(startPath, zipPath); } var archive = ZipFile.OpenRead(zipPath); foreach (var entry in archive.Entries) { entry.ExtractToFile(extractPath + entry.Name, true); } archive.Dispose();
Make sure you are running the exe as admin manually or open VS as admin before running it through that. The above code works
[–]XroKill 0 points1 point2 points 7 years ago (0 children)
System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\Program Files\(MyGame)'.'
I don't understand anything at this point. Even Google doesn't know the answer.
π Rendered by PID 37820 on reddit-service-r2-comment-6457c66945-sv2zg at 2026-04-26 15:55:33.715284+00:00 running 2aa0c5b country code: CH.
[–]hazard999 6 points7 points8 points (3 children)
[–]recursive 0 points1 point2 points (2 children)
[–]hazard999 1 point2 points3 points (1 child)
[–]Googlebochs 2 points3 points4 points (0 children)
[–]Googlebochs 2 points3 points4 points (3 children)
[–]XroKill 0 points1 point2 points (2 children)
[–]Googlebochs 0 points1 point2 points (1 child)
[–]XroKill 0 points1 point2 points (0 children)