本文介绍了在javascript和vb.net中转义多个反斜杠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我需要帮助在vb.net中使用javascript在文件下载时转义反斜杠。我正在下载的文件是这样的:



\\Faheem-i5 \recordings\TTGILBetterValue \20130122_195234_006387_1633548400.wav



该文件正在下载但名称如下:



_Faheem-i5ecordingsTTGILBetterValue�30122_195234_006387_1633548400



有谁可以向我解释为什么会发生这种情况以及如何从字符串中逃避双反斜杠和单反斜杠。



谢谢

Hi there,

I need help escaping backslashes on a file download in vb.net with javascript. The file I am downloading is like this:

\\Faheem-i5\recordings\TTGILBetterValue\20130122_195234_006387_1633548400.wav

the file is being downloaded but being named as follows:

_Faheem-i5 ecordingsTTGILBetterValue�30122_195234_006387_1633548400

Can anyone explain to me why this is happening and how do i escape the double backslashes and single backslashes from the string.

Thanks

推荐答案

var file_name = "\\Faheem\songs\TTGILBetterValue\000000.wav";
file_name = file_name.replace(/\\/g, "");

// NOTE: make sure that file_name contains \r, \n, \t chars or not...


这篇关于在javascript和vb.net中转义多个反斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 21:30