SharpZip 转义文件名

发布于 2024-08-25 22:21:03 字数 353 浏览 3 评论 0原文

我正在使用 SharpZipLib 创建一个包含 html 页面和图像的 zip 文件。如果 html 文件的名称中包含 /,则会创建一个文件夹(这会弄乱图像路径)。

示例:如果 html 文件应命名为 Web/Design.html,则 zip 文件将包含一个 Web 文件夹,其中包含 Design.html 文件它。

我尝试通过用 // 或 / 替换 / 来转义 / 但到目前为止没有任何效果。

I'm using SharpZipLib to create a zip file with an html page and images. If the html file has a / in the name, it creates a folder (which messes up the image paths).

Example: If the html file should be named Web/Design.html the zip file will contain a Web folder with a Design.html file in it.

I've tried escaping / by replacing / with // or / but nothing has worked so far.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人心善变 2024-09-01 22:21:03

文件名中通常不能包含斜杠。我建议你用 _ 或类似的东西替换 / 。

Filenames can't generally have slashes in them. I suggest you replace / with _ or something similar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文