Can't seem to make a universal filepath
Hi there could anyone explain how I can make a universal filepath so other pc's can locate the files, and make changes to them?
Here I will post a picture of my attempts:
![No description](https://cdn.answeroverflow.com/1181492711849738260/image.png)
59 Replies
Your second comment seems right
Environment.SpecialFolder
is what you want to use
Or just use relative paths to place the files next to the executablethat still wont give ya access from other PCs would it?
But even when using that one somehow the file cant be located on other pc's
You mean, like, me being able to access your files? Well no, it's got nothing to do with remote access
nono
Well, I assume the file exists on your PC
Does it exist on theirs?
like when you pull the program from github
Do you, in any way, ensure that it does?
there are multiple ways of sharing, some of these are
- host an FTP server on the machine
- host an HTTP server/some web application on the machine
- using SMB to share files/folder (this is the network sharing protocol which windows uses)
when my group pulls the project they get the file, but then they cant change anything in the file because their filepath is different from mine
You did not notice the "nono"?
Well, you will need to ensure the file actually exists in this location
For example, you might have a
stuff.txt
file on your desktop
But other people might not
So... you will need to ensure they do, somehowso they need to have it excatly the same place as mine?
Either use relative paths and package all the necessary files together with your app
Or create the file at runtime
Or otherwise ensure the file exists
?
Well, yes
If your program expects a
stuff.txt
file to be on the desktop, and it's not there, what is it to do?