带有前缀和编号的文件名 [英] File name with prefix and number
本文介绍了带有前缀和编号的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个问题,我想创建这个xml文件的文件名:
i have this problem, I want create this filename of xml file:
NOHEL+number.xml
数字来自变量号,当我发送文件时,我总是在其中加+1.NOHEL是前缀.范例:
The number is from variable number, where i added +1 always when i send file out. NOHEL is prefix. Exapmle:
NOHEL1.xml
NOHEL2.xml
NOHEL3.xml
我想给那里...
string strFileName = @"C:\\Users\\L\\Desktop\\NOHEL+number.xml";
您有什么想法吗?
推荐答案
尝试一下:
string strFileName = @"C:\Users\L\Desktop\NOHEL" + number + ".xml";
顺便说一句,当您拥有 @
时,不需要使用 \
转义字符.
By the way, you don't need to escape characters with \
when you have @
.
这篇关于带有前缀和编号的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文