Directory.GetCurrentDirectory() [英] Directory.GetCurrentDirectory()

查看:183
本文介绍了Directory.GetCurrentDirectory()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
在Windows C#.net中
在程序中,我正在使用"Directory.GetCurrentDirectory()"
获取目录路径,但显示错误名称" Directory"在当前上下文中不存在"
这是什么,如何避免错误
否则,有什么方法可以在Windows application

hi
in windows C#.net
in the program i am using the "Directory.GetCurrentDirectory()"
to get the directory path but it was showing error "the name ''Directory'' does not exist in the current context"
what is this and how can i avoid the error
other wise is there any way to find out the physical path of our application directory in windows application

推荐答案

中找到任何应​​用程序目录的物理路径:
1.在标题OR
中设置using System.IO; 2.使用全名,例如System.IO.Directory.GetCurrentDirectory()
Either:
1. Set using System.IO; in the header OR
2. Use full name like, System.IO.Directory.GetCurrentDirectory()


Hi,
您是否在程序中添加了"using System.IO"?
Hi,
Did you add "using System.IO" in your program?


要获取应用程序可执行文件所在的路径,请使用Application.StartupPath
To get the path where the application executable resides use Application.StartupPath


这篇关于Directory.GetCurrentDirectory()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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