回覆列表
  • 1 # 使用者7719957052162

    下面程式碼是第一次執行時讀取複製是第一行內容,再一次執行就是第二行的

    FileName="c:\123.txt""修改成你要複製字元到剪下板的檔案

    Setfso=CreateObject("scripting.filesystemobject")

    setws=createobject("wscript.shell")

    configPath=ws.ExpandEnvironmentStrings("%systemroot%")&"\~!filetmp"

    setconfObject=fso.opentextfile(configPath,1,1)

    FignNum=""

    ifnotconfObject.atendofstreamthenFignNum=confObject.readline

    ifFignNum=""or(notisNumeric(FignNum))thenFignNum=1

    sig="1"

    Setfo=fso.OpenTextFile(FileName,1,1)

    whilenotfo.atendofstream

    text=fo.readline

    ifcint(sig)=cint(FignNum)then

    SetForm=CreateObject("Forms.Form.1")

    SetTextBox=Form.Controls.Add("Forms.TextBox.1").Object

    TextBox.MultiLine=True

    TextBox.Text=text

    TextBox.SelStart=0

    TextBox.SelLength=TextBox.TextLength

    TextBox.Copy

    writefileAddFignNum

    wscript.quit

    endif

    sig=sig+1

    wend

    msgbox"檔案已經到末尾,下次將又重第一行開始複製"

    callwritefile

    subwritefile

    setf=fso.opentextfile(configPath,2,1)

    f.writeline"1"

    f.close

    endsub

    subwritefileAdd(value)

    setf=fso.opentextfile(configPath,2,1)

    f.writelinevalue+1

    f.close

    endsub

  • 中秋節和大豐收的關聯?
  • 本人27歲,想報考音樂劇研究生又擔心就業困難,該如何選擇?