I have a .net winforms application used in LAN by the company's employees, and it should access a network share to copy files to it. The share has credentials that should not be known to end users. What is the best practice to provide the credentials when accessing the share without hard-coding or exposing them to end users?
The best practice is not to use credentials embedded into the application.
Think of Kerckhoffs's principle: You should assume that attacker knows everything about your application. It it contains an embedded password, then you should assume the attacker knows it, too.
What can be alternatives?
A) On the share drive create a directory for each user and set permissions, so that only particular user can access it.
B) You can use PKI, or more precisely, a hybrid encryption based on PKI. Your application can encrypt files using public key before uploading them to the share. Then despite everyone can download files no one would be able to decrypt them.