![]() |
|
|||||||
| Register | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Registered Member
Join Date: Jun 2004
Posts: 4
|
is it possible to write in a file using vbscript with ppc 2003???
Someone is able to write in a file under ppc 2003 using vbscript??????
when I type : "Dim oFS,oTS Set oFS = CreateObject("Scripting.FileSystemObject") Set oTS = oFS.OpenTextFile("\test.txt", 2, True)" I got an activeX error : "Activex component can't create object" Any Idea to solve that???? thanks |
|
|
|
|
|
#2 (permalink) |
|
Did you do the math?
Join Date: Apr 2002
Location: Villa Straylight
Posts: 10,002
|
It would appear from that error message that the Active X DLLs aren't loaded. I've not done any scripting on a PPC, so take this with a grain of salt. My suggestion is to search the MS Knowledge Base.
By the way, crossposting is against the Rules. The other post with this same question has been removed.
__________________
Thorn Sex and Violence. You can't enjoy one, if you don't survive the other. (And that works both ways...) Last edited by Thorn : 07-23-2004 at 06:35 AM. |
|
|
|
|
|
#4 (permalink) |
|
Registered Member
Join Date: Jun 2004
Posts: 4
|
Ok after long search I can do that using another thing:
you simply need to do that . The source is a little special because I want to access the file alone, locking the other programs to do that. Only the WriteSetting or ReadSetting function is usefull. I learn that in a foreign site (anybody now the country?) that you can find at: http://www.eitcenter.com/pocketpc/de...amewrite18.htm Sorry for the comments but I m French, If you need more informations just ask. Const fsModeInput = 1 Const fsModeOutput = 2 Const fsModeRandom = 4 Const fsModeAppend = 8 Const fsModeBinary = 32 Const fsAccessRead = 1 Const fsAccessWrite = 2 Const fsAccessReadWrite = 3 Const fsLockReadWrite = 0 Const fsLockWrite = 1 Const fsLockRead = 2 Const fsLockShared = 3 Const monFichier = "\vbsTest.txt" Dim cpt,tmp,tmp2 cpt = 1 tmp = 0 tmp2 = 0 Do While cpt < 10000000000000000000000 tmp = Second(FormatDateTime(now,3)) WriteSetting "Ap1", -53,100, fsModeOutput 'créer un nouveau fichier vide WriteSetting "Ap2",42,100,fsModeAppend WriteSetting "Ap3", 45, 100,fsModeAppend do while tmp = tmp2 tmp = Second(FormatDateTime(now,3)) loop tmp2 = tmp 'JoueSon loop 'msgbox ReadSetting("ap2") Public Sub WriteSetting(ByVal ssid, ByVal signal,ByVal noise, iMode) Dim filWrite,numerr,abouterr On Error Resume Next 'on regarde si le fichier peut etre lu Set filWrite=CreateObject("FileCtl.File") numerr = 1 Do While numerr <> 0 Err.number = 0 filWrite.open monFichier, iMode, fsAccessWrite, fsLockReadWrite numerr = Err.number abouterr = Err.source loop filWrite.LinePrint FormatDateTime(now,3) & "$" & ssid & "$" & signal & "$" & cpt cpt = cpt + 13 filWrite.close Set filWrite=Nothing 'JoueSon End Sub Public Function ReadSetting(ByVal ssid) Dim filRead Set filRead=CreateObject("FileCtl.File") filRead.open monFichier, fsModeInput do while not filRead.EOF sLine=filRead.LineInputString Myarray = split(sLine,"$",-1,1) if LCase(myarray(1))=LCase(ssid) then ReadSetting=myarray(2) end if loop filRead.close Set filRead=Nothing End Function Public Sub JoueSon PlaySound "\windows\alarm3" End Sub Sub OnScanResult(SSID, BSSID, CapFlags, Signal, Noise, LastSeen) ' MsgBox "OnScanResult " & SSID & " " & BSSID & " " & CapFlags & " " & Signal & " " & Noise & " " & LastSeen if cpt = 3 then WriteSetting SSID,Signal,Noise,fsModeOutput else WriteSetting SSID,Signal,Noise,fsModeAppend End if end sub |
|
|
|