作业帮 > 综合 > 作业

Application.StartupPath.Substring(0,Application.StartupPath.

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/26 03:15:03
Application.StartupPath.Substring(0,Application.StartupPath.Substring())
Application.StartupPath.Substring(0,Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"))这句代码神马意思?这是指的哪条路径?
应该是:Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf("\\"));Application.StartupPath:表示可启动的可执行文件的路径,就是你运行的这个程序的文件路径;.LastIndexOf("\\")):表示获取字符串中最后一个"\"所在位置,是一个整数值;.Substring(a,b):表示从字符串的第a的位置开始,截取长度为b的字符
希望能解决您的问题.
再问: 只能是当前运行程序的路径么?那要获取其它盘符里的路径怎么设置?