zoukankan      html  css  js  c++  java
  • 改动文件名称

    妙用ASP改动文件名

    例如说我如今有一个文件已存在。路径是‘d:files est.asp’,我想把它改名为new.asp。路径不变,应该怎么写?
    例如以下:
    Set fso = Server.CreateObject("Scripting.FileSystemObject") 
    Set f = fso.GetFile("d:files est.asp")
    f.name ="new.asp"
    newname=f.name
    response.write newname '显示为:new.asp

    另一方法:
    Set fso = Server.CreateObject("Scripting.FileSystemObject") 
    fso.movefile "d:files est.asp","d:files ew.asp"

    ================================================================================

    Name 属性        
    描写叙述

    设置或返回指定文件或目录名。读/写属性。

    语法

    object.Name [= newname]

    Name 属性有下列几部分:

    部分 描写叙述 
    object 必需的。

    总是某个 File 或 Folder 对象的名字。

     
    newname 可选的。假设提供的话,newname 是指定的 object 的新名。


    说明

    以下的代码举例说明了 Name 属性的使用方法:

    Sub ShowFileaccessInfo(filespec)
        Dim fs, f, s
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFile(filespec)
        s = f.Name & " on Drive " & UCase(f.Drive) & vbCrLf
        s = s & "Created: " & f.DateCreated & vbCrLf
        s = s & "Last accessed: " & f.DateLastaccessed & vbCrLf
        s = s & "Last Modified: " & f.DateLastModified 
        MsgBox s, 0, "File access Info"
    End Sub

  • 相关阅读:
    C++调用web服务(java事例供参考)
    ASP.NET1.1与2.0如何引入MagicAjax (转载自http://hi.baidu.com/zzticzh)
    爱,在世界末日时
    Why Google Chrome is Multiprocess Architecture
    Chrome
    Code Reuse in Google Chrome
    Google V8 JavaScrit 研究(1)
    第一篇文章
    User Experience
    WPF
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5282089.html
Copyright © 2011-2022 走看看