如何使用C#在mysql中插入\ [英] How to insert \ in mysql using C#
本文介绍了如何使用C#在mysql中插入\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我也在尝试使用C#将包含\的URL保存到mysql中,很遗憾,我不能!!!而且我不想使用正则表达式并更改URL,因为它将不再起作用!!!
请提出您的想法.我该怎么办?
关于
Hi ALL,
I am trying too save a urls consisting \ into mysql using C#, "Unfortunately I can not!!! and I don''t want to use regular expressions and change the URL as it will not work anymore!!!
Please give your ideas..What should I do?
Regards
推荐答案
使用转义序列"\",即,使用两个反斜杠,将输入一个反斜杠.
或
您可以根据需要调用mysql_real_escape_string插入转义符.
Use escape sequence ''\'', i.e. use two backslashes and one will be entered.
Or
you can call mysql_real_escape_string to insert escape characters as necessary.
这篇关于如何使用C#在mysql中插入\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文