我正在.vbs文件中创建一个具有以下节点值的xml文件,
<car>David's</car>
<company>Mannar & Co.</company>
Run Code Online (Sandbox Code Playgroud)
在解析此xml时,我发现&等问题。
我想将所有可能的 xml特殊字符转换为编码字符(带有函数或其他内容),以便在解析时得到原始内容。
感谢您。
我创建了一个应用程序,一旦达到目标日期和时间就显示新闻稿,并想知道这是从服务器或客户端获取时间,因为我想使用服务器的时间,以便有人不只是改变他们的时钟,以便看到它.
这是我的代码:
<%
dim strDate
dim strTime
dim strTarget_time
dim strTarget_date
dim strBreak
dim strRuleBreak
dim strToday
strDate = Date()
strTime = Time()
strright_now = Now()
strTarget_time = "3:27:00 PM"
strTarget_date = "6/26/2012"
strBreak = "<br />"
strRuleBreak = "<br /><hr><br />"
strToday = Now()
response.write("<h2>TEST VARIABLES</h2>")
response.write("<p><strong>Today's date:</strong> " & strDate & strBreak)
response.write("<strong>Current time:</strong> " & strTime & strBreak)
response.write("<strong>Target date:</strong> " & strTarget_date & strBreak)
response.write("<strong>Target time:</strong> " & strTarget_time & "</p>")
response.write(strRuleBreak)
'TIME TESTER
response.write("<h2>TIME TESTER</h2>") …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用以下VB脚本从Windows Temp文件夹中删除所有以字符串“ MyApp”开头的日志文件。
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FolderExists("C:\Documents and Settings\guest\MyApp") Then
set folder = objFSO.getFolder("C:\Documents and Settings\guest\MyApp")
if folder.files.Count <> 0 then
objFSO.DeleteFile "C:\Documents and Settings\guest\MyApp\*.*", True
end if
objFSO.DeleteFolder "C:\Documents and Settings\guest\MyApp", True
end if
<!-- The below code is not deleting the files which starts with the name "Mpp.023648011.log" -->
if(objFSO.FileExists("C:\Documents and Settings\guest\Local Settings\Temp\MyApp.*")) Then
objFSO.DeleteFile "C:\Documents and Settings\guest\Local Settings\Temp\MyApp.*", True
end if
Run Code Online (Sandbox Code Playgroud)
似乎以下检查失败:
if(objFSO.FileExists(“ C:\ Documents and Settings \ guest \ Local Settings \ …
我正在办公室的Offiice Access工作.我注意到没有很多控件可供使用,但我要求在结构(不是列表框或组合框)的表格中显示数据.我怎么能做到这一点呢?
任何人都可以告诉我是否可以将Response对象从经典asp传递给C#类库,如果是这样,它是如何完成的.
我在ASP中使用C#2010 express和JScript,但我会接受VBScript的回答.
或者如果有另一种方法从dll输出到经典asp页面的http上下文,那也可以.
我认为它无法完成,因为System.Web.HttpResponse对象似乎不能从类库中获得.
谢谢那些回复的人.通过对可能有相同问题的其他人的完整答案,这里是一些示例代码:
public string passObj(ASPTypeLibrary.Response r)
{
r.Write("text from DLL");
return "OK";
}
Run Code Online (Sandbox Code Playgroud)
在经典的asp方面:
var x = Server.CreateObject("dllTest.test");
x.passObj(Response);
Run Code Online (Sandbox Code Playgroud) 我一直在将一些旧的VBscript代码重写为VB代码.我几乎完成了所有事情,但我在一个地方得到了一个错误.
VB脚本
Session("FirstName") = Request.Cookies("FirstName").Item
Run Code Online (Sandbox Code Playgroud)
VB
Session.Add("FirstName", Request.Cookies("FirstName").Item)
Run Code Online (Sandbox Code Playgroud)
而错误是
BC30455: Argument not specified for parameter 'key' of 'Public Default Property Item(key As String) As String'.
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何纠正这个错误或至少错误是什么意思?提前致谢.
我正在使用VBScript处理Classic Asp.我正在尝试使用下载选项显示目录中的文件列表.喜欢,
当我点击下载链接时,需要下载相应的文件,因为我使用了以下代码,
<html>
<head>
<title> My First ASP Page </title>
</head>
<body>
<%
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjFiles
Dim ObjFile
'Creating File System Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting the Folder Object
Set ObjFolder = fso.GetFolder("F:\karthik")
'Creating an Output File to write the File Names
Set ObjOutFile = fso.CreateTextFile("F:\WindowsFiles.txt")
'Getting the list of Files
Set ObjFiles = ObjFolder.Files
'Writing Name and Path of each File to Output File
Response.Write("<table cellpadding=""4"" cellspacing=""5"" >")
For Each ObjFile In …Run Code Online (Sandbox Code Playgroud) 大家早上好,我一直试图将一个VBscript拉到一起,该脚本在脚本被激活时从用户那里获取文件路径和文件名(可能有一个通配符).然后,脚本将检查指定目录中是否有与提供的文件名匹配的文件,然后查看上次修改日期以查看它是否在特定时间范围内(即早上6点加减5分钟)创建/修改.然后它会将所述文件复制到zip文件中.
到目前为止,我已经能够使参数工作,并且我已经设置了获取当前时间,查看文件夹中的文件并将硬编码文件名与文件夹中的文件名匹配.这是我迄今为止所拥有的.
currentTime = Now()
filePath = Wscript.Arguments.Item(0)
fileName = Wscript.Arguments.Item(1)
Set fileSystem = CreateObject("Scripting.FileSystemObject")
Set directory = fileSystem.GetFolder(filePath)
For each file in directory.Files
If file.Name = fileName Then
Wscript.echo file.Name & " " & file.DateLastModified
end if
Next
Run Code Online (Sandbox Code Playgroud)
我是一个VBscript noob,我期待着学习的方式!
CAP3
我是VBscript的新手,并且努力学习所有概念.在我练习期间,我感到疑惑.
dim a,b,c
set a = CreateObject("scripting.filesystemobject") 'initiate the file system object'
set b = a.GetFolder("E:\test") 'returns a object . and for the instance that varaiable b refers to that returned object'
c = b.datecreated 'accesing and storing the property to a variable /C/'
msgbox "folder: " &c
Run Code Online (Sandbox Code Playgroud)
当我执行此时没有错误消息,它工作正常.但是当我改变的时候
c = b.datecreatedTO set c = b.datecreated比
它显示了这个错误:
> object required:'datecreated'
Run Code Online (Sandbox Code Playgroud)
我知道这是一件基本的事情,但有些时候小事情会让你学到很多东西,对未来有所帮助.
我在VBScript中创建了一个类,并在asp经典中用它来实现一个对象:这是我的类:
<%
Class RBAC
Public dateTimeValue
Public userIdValue
Public fileIdValue
Public actionValue
Public Property Get DateTime()
'Gets the propery value
DateTime = dateTimeValue
End Property
Public Property Set DateTime(value)
'Sets the property value
dateTimeValue = value
End Property
Public Property Get UserId()
'Gets the propery value
UserId = userIdValue
End Property
Public Property Set UserId(value)
'Sets the property value
userIdValue = value
End Property
Public Property Get FileId()
'Gets the propery value
FileId = fileIdValue
End Property
Public Property Set …Run Code Online (Sandbox Code Playgroud) vbscript ×10
asp-classic ×4
c# ×1
class ×1
httpresponse ×1
ms-access ×1
ms-office ×1
office-2010 ×1
qtp ×1
vb.net ×1
vba ×1
windows ×1
xml ×1