Save Byte Array to UNC Path

c#

Solution

I believe this is because the double backslash isn't escaped.

Try this instead:

System.IO.File.WriteAllBytes(@"\\server\tmp\" + FileName, fileData);

Problem

When I use ``` System.IO.File.WriteAllBytes("\\server\\tmp\\" + FileName, fileData); ``` It always seems to add "C:" to the beginning so it tries to save to c:\server\temp... Is there a way around this?

Original source