Conifg Files und die Benutzung
Verfasst: 31.05.2008 09:49
Hi, ich bin bei meinem Netzwerk Sync Programm nun fast fertig...
Aber nun habe ich ein Problem beim auslesen meiner Cofig Files...
Ich weiss nicht was ich machen muss... Er gibt mir ne Fehlermeldung
Case without Select aus aber was soll ich denn da machen?
Hier mal mein kompletter Source
Hoffe ihr könnt mir helfen
Gruß
Fox
Aber nun habe ich ein Problem beim auslesen meiner Cofig Files...
Ich weiss nicht was ich machen muss... Er gibt mir ne Fehlermeldung
Case without Select aus aber was soll ich denn da machen?
Hier mal mein kompletter Source
Code: Alles auswählen
#TreeGadget = 0
Procedure ReadDirs(Path.s, Rek.l)
If Right(Path, 1) = "\" : Path = Left(Path, Len(Path) - 1) : EndIf
NextOK.l
Name.s
ExamineDirectory(Rek, Path, "")
Repeat
NextOK = NextDirectoryEntry(Rek)
Name = DirectoryEntryName(Rek)
If NextOK = 2 And Name <> "." And Name <> ".."
ReadDirs(Path + "\" + Name, Rek + 1)
While WindowEvent() : Wend
ElseIf NextOK = 1
AddGadgetItem(0, -1, Path + "\" + Name)
EndIf
Until NextOK = #False
EndProcedure
Procedure ReadDir(Path.s, Rek.l)
If Right(Path, 1) = "\" : Path = Left(Path, Len(Path) - 1) : EndIf
NextOK.l
Name.s
ExamineDirectory(Rek, Path, "")
Repeat
NextOK = NextDirectoryEntry(Rek)
Name = DirectoryEntryName(Rek)
If NextOK = 2 And Name <> "." And Name <> ".."
ReadDirs(Path + "\" + Name, Rek + 1)
While WindowEvent() : Wend
ElseIf NextOK = 1
AddGadgetItem(1, -1, Path + "\" + Name)
EndIf
Until NextOK = #False
EndProcedure
Enumeration
#Window_0
EndEnumeration
;
Enumeration
#Listview_0
#Listview_1
#Button_0
#Button_1
#Button_2
EndEnumeration
If OpenWindow(#Window_0, 216, 0, 600, 346, "Netzwerk Sync", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ListViewGadget(#Listview_0, 325, 10, 235, 265)
ListViewGadget(#Listview_1, 15, 10, 235, 265)
ButtonGadget(#Button_0, 255, 95, 65, 35, "-->")
ButtonGadget(#Button_1, 255, 155, 65, 35, "<--")
ButtonGadget(#Button_2, 195, 320, 170, 20, "Configuartion")
ReadDirs("\\User\SharedDocs", 0)
ReadDir("C:\", 1)
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case #Button_0
n = 3
If ReadFile(0, "config.ini")
For z = 1 To n-1
ReadString(0)
Next
CloseFile(0)
Else
MessageRequester("","Config File not found")
n = 7
If ReadFile(1, "config.ini")
For z = 1 To n-1
ReadString(1)
Next
CloseFile(1)
Else
MessageRequester("","Config File not found")
CopyDirectory(ReadString(0), ReadString(1), "", #PB_FileSystem_Recursive)
MessageRequester("","Synchronizing finished")
Case #Button_1
CopyDirectory("\\User\SharedDocs\bilder", "C:\", "", #PB_FileSystem_Recursive)
Case #Button_2
XIncludeFile "config.pb"
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
End
End
EndSelect
EndSelect
Until event=#PB_Event_CloseWindow
EndIf
EndIf
EndIf
Gruß
Fox