'-------------------------
'--check if the directory exists
'----------------------
Function Checkdir (ByVal folderpath)
Dim fso
Set FSO = Server.CreateObject ("Scripting.FileSystemObject")
If FSO. FolderExists (Server.MapPath (folderpath)) Then
' Existence
Checkdir = True
Else
' does not exist
Checkdir = False
End If
Set FSO = Nothing
End Function
'-------------------------
'--Create a directory
'--------
String Server.MapPath (String path)Returns the physical file path corresponding to the specified virtual path on the Web server.server.mappath (request.servervariables["Path_info"])server.mappath ("/")server.mappath ("")server.mappath (".")server.mappath (".. /")server.mappath ("..") Page.Request.ApplicationPathThe results of the above code are as follows:c:/inetpub/wwwroot/englishclub/manage/webform1.aspx£c:/inetpub/wwwroot/c:/inetpub/wwwroot/englishclub/managec:/inetpub/ww
To determine if a directory exists and create a directory:
testwhetherthedirexist cstringm_dir; if (M_dir. Right (1) == "//") m_dir=m_dir. Left (M_dir. GetLength ()-1); if (GetFileAttributes (m_dir) ==file_attribute_directory) return ture; else createalldirectory (m_dir); //functioncreatealldirectory//recursivefunction void Createalldirectory (Cstringdir) {if (Dir.right (1) == "//") Dir =dir.left (Dir.g
Steps:
1. Traverse Directory and subdirectories
2. Use Scandir to determine whether the directory is empty, empty, and use rmdir to delete it.
Using a shell is a lot simpler:
Find target folder-mindepth 1-depth-empty-type d-exec rm-r {} \;
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/
Label:After the database sql2008 installed, regardless of backup or restore, can only see the C drive, manually enter the path, the error is as follows: when attempting to open or create a physical file ' d:\ database \db.mdf ', the creation file encounters operating system error 5 (Access denied. )Workaround:In all Programs-sql Server 2008-Configuration Tools-"SQL Server Configuration Manager", click on "SQL Server 2008 Services", right key ' properties '--' login tab ', built-in account select
"alt=" Wkiol1dljgfbzswvaaaiwqdpqmw467.png "/>Cannot enter when the permission is 020650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/EC/wKiom1dlJGfwpJ75AAAi-Q-vtzs538.png "style=" float: none; "title=" Linux6.png "alt=" Wkiom1dljgfwpj75aaai-q-vtzs538.png "/>Cannot enter when the permission is 040650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/EC/wKiom1dlJGeApgAhAAAik5VPewE668.png "style=" float: none; "title=" Linux7.png "alt=" Wkiom1dljgeapgahaaaik5vpewe668.png "/>Wh
PHP traverses the directory, generates the MD5 value of each file in the directory and writes to the result file
Instance code:
Thank you for reading, I hope to help you, thank you for your support for this site!
Label: tar package compression specified directorySometimes, we may need to compress the file/directory to the specified directory. For example, to compress all the files and directories in the/home And/boot directories to the Bak directories, you must first create a Bak directory, copy the/home And/boot directories to the Bak
Unlimited directory replication, stationmaster original, although only wrote a few minutes, but still very useful
$o _path= "admin";//Source Directory
$n _path= "n_admin";//New Directory
Class Copy_path
{
function Wm_chief_copypath ($o _path, $n _path)
{$hand =opendir ($o _path);
if (!file_exists ($n _path))//target directo
PHP removes the entire directory that matches the criteria, matches the entire directory
PHP
/** * @name The Delfile function is used with the Deldir function to delete the entire directory that matches the condition * @param string $path Specify the action path * @return Null * @example deldir (' D:\web\Apache\htdocs\KeyShareMall\Pc\ThinkPHP '); */ D
Org.springframework.context.support.classpathxmlapplicationcontext;import Org.springframework.context.support.filesystemxmlapplicationcontext;import Org.springframework.test.context.contextconfiguration;import Org.springframework.test.context.junit4.springjunit4classrunner;import com.wql.vo.user;/** * Spring Test * The load file is placed under the class directory * @author Lenovo * */@RunWith (Springjunit4classrunner.class) @ContextConfiguration ("C
Grandma's, made a day, with Maven Fortunately, a built automatic health specification of the project directory, this gradle on the internet to look at a variety of examples. With the building is not the same, in anger under the study of the end, this is how to change how to change!Server project directory Building, Gradle build Project Web directory, source Folde
1. Write a program to copy all the. java files from the D: \ java directory to the D: \ Jad directory and change the original file extension from. java to. jadPackage Copy;import Java.io.bufferedinputstream;import java.io.bufferedoutputstream;import java.io.File;import Java.io.fileinputstream;import Java.io.fileoutputstream;import Java.io.filenamefilter;import java.io.IOException; Import Java.io.inputstream
Program | execution
1. System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filenameGets the full path of the module.2. System.Environment.CurrentDirectoryGets and sets the fully qualified directory of the current directory (the directory from which the process starts).3. System.IO.Directory.GetCurrentDirectory ()Gets the current working
Ladies and gentlemen, let's continue with two more cases today.
C. Case three:
Scenario: Single domain environment, all DCS crash, backup available.
Objective: To restore the domain environment.
Solution:
1 in the first server, reload Windows2003. (here requires hardware configuration as far as possible and the original consistent, if the difference is large, you can refer to a Microsoft document, KB number is not clear ~ ~ ~ ~, find again to tell you.) )
2) to re-establish the purpose of
Mkdir/var/FTP // (create an FTP directory) chown FTP/var/FTP // (make the user FTP the owner of/var/FTP, and anonymous access will be disabled later, therefore, this step is required) chmod o-x/var/FTP/* (revoking the user's FTP permission to execute all files under/var/FTP/, which makes it safer. */Passwd FTP // (set the user's FTP password) Vim/etc/password // (edit the password file and change the FTP home dire
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.