我想在c文件夹中自动保存一个excel文件,因为它写了一段代码,但它并没有被淹没 [英] i want to save an excel file automatically in c folder for that iwritten a code but it is not wroking

查看:123
本文介绍了我想在c文件夹中自动保存一个excel文件,因为它写了一段代码,但它并没有被淹没的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自动excel文件保存在c文件夹中,我写了如下代码;但错误显示为未识别的转义序列。从我的代码是什么错误。帮助我。





xlWorkBook.SaveAs(C:\Csharp.net-informations。 xls);



当我运行时显示错误未识别的转义序列。



来自我的上面的代码是什么错误。我该怎么办。



在c文件夹中自动保存excel文件。

解决方案

使用转义特殊字符的字符,例如:/ as //as /等



你也可以在你的情况下加@前缀。

< pre lang =cs> xlWorkBook.SaveAs( @ C:\ _Csharp.net-informations.xls< /跨度>);
xlWorkBook.SaveAs( C:\\Csharp.net-informations.xls);


您需要准确阅读两个Microsoft文档页面,第二个更重要:

http://msdn.microsoft.com/en-us/library/vstudio/362314fe.aspx [ ^ ]

Microsoft Q209354



祝你好运,

-SA


automatically excel file save in c folder for that i written a code as follows; but error shows as un recongized escape sequence. from my code what is the mistake.help me.


xlWorkBook.SaveAs("C:\Csharp.net-informations.xls");

when i run it shows the error un recongized escape sequence.

from my above code what is the mistake. how can i do.

to save an excel file automatically in c folder.

解决方案

Use escape characters for special characters, eg : / as // " as /" etc

You can also prefix @ in your case.

xlWorkBook.SaveAs(@"C:\Csharp.net-informations.xls");
xlWorkBook.SaveAs("C:\\Csharp.net-informations.xls");


You need to read exactly two Microsoft documentation pages, and the second one is way more important:
http://msdn.microsoft.com/en-us/library/vstudio/362314fe.aspx[^],
Microsoft Q209354.

Good luck,
—SA


这篇关于我想在c文件夹中自动保存一个excel文件,因为它写了一段代码,但它并没有被淹没的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆