probleme avec les fichiers !
Publié : dim. 08/janv./2006 19:10
je en c'est pas ce qui se passe mais mon prog ne créer pas mon fichier que se passe t-il ???

Code : Tout sélectionner
Enumeration
#Window_0
#Window_1
#Button_0
#Button_1
#Button_2
#String_0
#String_1
#Text_0
#Frame3D_0
#String_2
#Text_1
#Button_3
#Text_3
#String_3
#String_4
#String_5
#Text_2
#Text_4
#Text_5
#Text_6
#Button_4
EndEnumeration
If InitNetwork() = 0
End
EndIf
Procedure Open_Window_1()
If OpenWindow(#Window_1, 306, 254, 347, 132, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_WindowCentered , "Session CybMail")
If CreateGadgetList(WindowID())
StringGadget(#String_0, 90, 20, 130, 20, "")
StringGadget(#String_1, 90, 50, 130, 20, "")
StringGadget(#String_2, 90, 90, 150, 20, "")
TextGadget(#Text_0, 250, 95, 80, 20, "@cybermail.com")
TextGadget(#Text_1, 10, 25, 60, 20, "Nom :")
TextGadget(#Text_2, 10, 55, 60, 20, "Prénom :")
TextGadget(#Text_3, 10, 95, 80, 20, "Adresse E-Mail :")
ButtonGadget(#Button_0, 240, 20, 90, 50, "OK")
EndIf
EndIf
EndProcedure
Procedure Open_Window_0()
If OpenWindow(#Window_0, 188, 190, 514, 289, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_WindowCentered , "Cyber Mail")
If CreateGadgetList(WindowID())
ButtonGadget(#Button_0, 50, 220, 100, 30, "Deconection")
ButtonGadget(#Button_1, 20, 100, 180, 30, "Vérifier la connection d'un client")
ButtonGadget(#Button_2, 310, 30, 130, 30, "Envoyer un mail")
StringGadget(#String_3, 250, 120, 250, 140, "")
StringGadget(#String_4, 250, 80, 160, 20, "")
TextGadget(#Text_0, 420, 83, 90, 20, "@cybermail.com")
Frame3DGadget(#Frame3D_0, 230, 20, 280, 250, "MAIL")
StringGadget(#String_5, 40, 70, 90, 20, "")
TextGadget(#Text_1, 0, 75, 40, 20, "Client :", #PB_Text_Center)
ButtonGadget(#Button_3, 50, 170, 100, 30, "Carnet d'adresse")
TextGadget(#Text_3, 140, 70, 80, 20, "@cybermail.com")
EndIf
EndIf
EndProcedure
debut:
If OpenFile(0,"C:\WINDOWS\CybMail\Info")
fichier_util$ = ReadString()
CloseFile(0)
OpenFile(1,"C:\WINDOWS\CybMail\Clients")
fichier_clients$ = ReadString()
CloseFile(1)
open_window_0()
connectID = OpenNetworkConnection("192.168.1.3",5650)
If connectID
Repeat
Until WaitWindowEvent()=#PB_EventCloseWindow
CloseNetworkConnection(connectID)
End
EndIf
Else
open_window_1()
Repeat
If EventGadgetID() = #button_0
nom$ = GetGadgetText(#String_0)
prenom$ = GetGadgetText(#String_1)
adresse$ = GetGadgetText(#String_2)
Goto fin:
EndIf
Until WaitWindowEvent()=#PB_Event_CloseWindow
fin:
CloseWindow(#window_1)
CreateFile(2,"C:\WINDOWS\CybMail\Info")
WriteString("§!n%%o$o%%m$m%%n$!:="+nom$+"@§p%%r$r%%e$e%%?&?%%p$:="+prenom$+"@§%%&/$:="+adresse$)
CloseFile(2)
CreateFile(3,"C:\WINDOWS\CybMail\Clients")
CloseFile(3)
Goto debut:
EndIf


