请提供帮助,不支持给定路径的格式

问题描述 投票:-1回答:1

该代码已经使用了一年多,突然间它抛出错误消息“不支持给定路径的格式。”



     filepath = "C:\\\\FaxServer\\\\InBox\\\\1820200525_0 10:34 AM.pdf"
     if (!File.Exists(filePath))
     {
            FileStream Stream = new FileStream(filePath, FileMode.Create);
            BinaryWriter BinaryStream = new BinaryWriter(Stream);
            BinaryStream.Write(attachment.Body);
            BinaryStream.Close();
         }

c# console
1个回答
0
投票

提供正常的文件路径,但在字符串前使用@filepath =@"C:\FaxServer\InBox\1820200525_0 10:34 AM.pdf"应该不错。

© www.soinside.com 2019 - 2024. All rights reserved.