In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to use app.path, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
When the program opens the file, if it does not specify the directory of the file, it will open the file of the "current directory", but the current directory is often changed. If you specify a directory, then when you install the program in the future, the opened file must be installed in the specified directory, which is relatively inflexible. This problem can be resolved using app.path.
Apppath solution
The way to solve the above problems is to open the file by the following methods:
OpenApp.Path+ "\" + "File name" For ┅
And put the opened file in the same directory as the executable file, because App.Path represents the directory where the application is located. However, there is one thing to pay special attention to when using App.Path. When App.Path is in the root directory, the rightmost character of App.Path is "\", such as "c:\", but if App.Path is not in the root directory, the rightmost character of App.Path is not "\", such as "d:\ kj\ app1", so to get the full path name of a file in the directory where the application resides, you should use the following method:
DimfullpathAsString
IfRight (App.Path,1) = "\" Then' if App.Path is the root directory
Fullpath=App.Path+ "File name"
Else
Fullpath=App.Path+ "\" + "File name"
EndIf
'fullpath equals the full path name of the File name
Apppath source
SEO base
When there are multiple identical files under a program, such as "e:\ ksxt" directory, there are multiple files to find the same file, then the system will find the first file in a certain order, and as the need to use the file, so, in this case, it is best to make this directory has only one file. Just like this, students who use future education software to do computer second-level examination questions will always report an error, saying that if the input exceeds the end of the file, it is looking for the wrong file. As long as the complete directory of the file is typed, it will not be wrong.
Thank you for reading this article carefully. I hope the article "how to use app.path" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.