English 中文(简体)
使用NSBasic/CE 7.0复制文件
原标题:Copying Files Using NSBasic/CE 7.0

我正在使用 NSBasic/CE 7.0,我需要复制一个文件,但不知道如何在这个程序中复制,但是我现在已经有了这个:

AddObject "cecomdlg.commondialog.1", "ComSvDlg", 0, 0, 0, 0

Sub saveDialog()
  ComSvDlg.CancelError = 0
  ComSvDlg.DialogTitle = "Copy"
  ComSvDlg.Filter = "All Files|*.*"
  ComSvDlg.ShowSave
  If Err.Number = 0 Then
    txtFileName = ComSvDlg.FileName
    MsgBox txtFileName
    ElseIf Err.Number = 32755 Then
      MsgBox "Canceled"
  End If
  KillFocus
End Sub

Sub mnuSave_Click
  saveDialog
  txtOutput.Text = ComSvDlg.FileName
End Sub

但是其中最重要的之一(复制),我不知道怎么做。能帮我复制文件从est.txtComSvDlg.Filename吗?

最佳回答

根据NS Basic/CE网站上的信息,它包括以下对象,提供文件系统管理功能:

要复制文件,您可以使用FileSystem.FileCopy方法或SFMain.CopyFile方法。代码应该像这样(未经测试,因为我没有NS Basic):

  # Using the FileSystem object
AddObject "FileSystem", "FS"
FS.FileCopy "	est.txt", ComSvDlg.FileName

  # Using the SFMain object
AddObject "newObjects.utilctls.SFMain", "FS"
FS.CopyFile "	est.txt", ComSvDlg.FileName
问题回答

暂无回答




相关问题
What approach should I use to test a VBScript?

I ve been asked to help out with a project which has made extensive use of VBScript to process a whole bunch of text files and generate certain outputs - sanitized files, SQL entries etc.. The script ...

Unable to call c# code from vbscript - ActiveX error

I am trying to call a method I have written in C# from VBScript. I have followed just about all of the instructions I can find on the web and am still having problems. Specifically I am getting Error:...

How to set delay in vbscript

How to set delay in vbscript? WScript.Sleep(100) does not work on Windows XP, Vista.

Using Classes in a Dictionary in Classic ASP

I usually do C# but have inherited a classic ASP project. I have defined a class: Class clsPayment Public Name End Class Set objPayment = New clsPayment objPayment.Name = "...

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

Problem casting field when querying spreadsheet

I am trying to query an .xls spreadsheet with VBScript, but I have run into an issue when trying to cast a field. I connect to the spreadsheet like this. Set objConnection = CreateObject("ADODB....

热门标签