Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esth彋ique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 Connect to Mydrive

View previous topic View next topic Go down 
AuthorMessage
ygeronimi

avatar

Number of posts : 14
Age : 46
Localisation : France
Registration date : 2013-03-13

PostSubject: Connect to Mydrive   Thu Mar 14, 2013 7:17 pm

Code:
' ------------------------------------------------------------------------------
dim D$,x%,M%,sep%,L$,L%
dim s$, res%, hnd%, hnd0%, titre$
' ------------------------------------------------------------------------------
label Init,Close0,Menu,F100,F200,Enregistrer,Supprimer,Quitter
label Init_F100,couleur104,Init_F200,Change202,Connection
' ------------------------------------------------------------------------------
dll_on "KGF.dll"
' 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
width 0,250:height 0,360:top 0,100:left 0,100:on_close 0,Close0
font_name 0,"Times new roman":font_size 0,10:Caption 0,"Connect to MyDrive"
hnd0% = handle(0)

main_menu 1
 sub_menu 2:parent 2,1:caption 2,"Fichier"
    sub_menu 3:parent 3,2:caption 3,"Quitter"
 sub_menu 4:parent 4,1:caption 4,"Edit"
    sub_menu 5:parent 5,4:caption 5," Ajouter "
    sub_menu 6:parent 6,4:caption 6," Supprimer "
for x%=2 to 6:on_click x% ,Menu:next x%
   
list 7:width 7,234:height 7,270:cursor_point 7:on_double_click 7,Connection

alpha 8:top 8,275:left 8,25
font_color 8,0,0,255:caption 8,"Double click pour s幨ectionner"

dlist 9

gosub Init
end
' 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
Init:
D$=Dir_current$
if file_exists(D$+"\Connect.Bdd")=1
  clear 9 :clear 7
  file_load 9,D$+"\Connect.Bdd"
  for x%=1 to count(9)
      L$=item_read$(9,x%)
      sep%=instr(L$,";")
      item_add 7,left$(L$,sep%-1)
  next x%
else
  file_open_write 10,D$+"\Connect.Bdd":file_close 10
end_if
return
' ------------------------------------------------------------------------------
Menu:
  for x%=2 to 6
      if clicked(x%)=1 then M%=x%
  next x%
  select M%
  case 2
  case 3
      gosub Close0
      gosub Quitter
  case 4
  case 5
      gosub F100
  case 6
      gosub F200
  end_select
return
' 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
F100:
  if object_exists(100)=1
      Show 100
  else
      form 100:width 100,250:height 100,160
      Font_name 100,"Times new roman":font_size 100,10:caption 100,"Ajouter un compte"
      command_target_is 100
      alpha 101 :top 101,10:left 101,10:caption 101,"Login :"
      edit 103  :top 103,28:left 103,10:width 103,150
      alpha 102 :top 102,50:left 102,10:caption 102,"Mot de passe :"
      edit 104  :top 104,68:left 104,10:on_change 104,couleur104
      button 105:top 105,95:left 105,155:caption 105,"Enregistrer":cursor_point 105
      on_click 105,Enregistrer
  end_if
  gosub Init_F100
return
' ------------------------------------------------------------------------------
Init_F100:
  text 103,""
  text 104,"panoramic123":font_color 104,210,210,210
return
' ------------------------------------------------------------------------------
couleur104:
  font_color 104,0,0,0
return
' 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
F200:
  if object_exists(200)=1
      Show 200
  else
      form 200:width 200,250:height 200,120
      Font_name 200,"Times new roman":font_size 200,10:caption 200,"Supprimer un compte"
      command_target_is 200
      alpha 201 :top 201,10:left 201,10:caption 201,"Compte"
      combo 202 :top 202,28:left 202,10:width 202,150:on_change 202,Change202
      button 203:top 203,55:left 203,155:caption 203,"Supprimer":cursor_point 203
      on_click 203,Supprimer
  end_if
  gosub Init_F200
return
' 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
Init_F200:
  Clear 202
  for x%=1 to count(9)
      L$=item_read$(9,x%)
      sep%=instr(L$,";")
      item_add 202,left$(L$,sep%-1)
  next x%
return
' ------------------------------------------------------------------------------
Change202:
  L%=item_index(202)
return
' ------------------------------------------------------------------------------
Enregistrer:
  item_add 9,trim$(text$(103))+";"+trim$(text$(104))
  file_save 9,D$+"\Connect.Bdd"
  gosub Init
  gosub Init_F100
return
' ------------------------------------------------------------------------------
Supprimer:
  item_delete 9,L%
  file_save 9,D$+"\Connect.Bdd"
  gosub Init_F200
  gosub Init
return
' ------------------------------------------------------------------------------
Connection:
  hide 0
  Execute "http://www.mydrive.ch/login"
  repeat
      pause 1000
      titre$ = string$(255," ")
      hnd% = dll_call1("GetActiveWindowTitle",adr(titre$))
      titre$ = trim$(titre$)
  until instr(titre$, "Login |" )>0
  pause 1000
  hide 0
  pause 1000
  titre$ = string$(255," ")
  hnd% = dll_call1("GetActiveWindowTitle",adr(titre$))
  if instr(titre$, "Login |" )=0
      show 0
      message "Il faut d'abord cliquer sur [MyDrive] !"
      message "Le titre actuel est: ["+titre$+"]"
    return
  end_if
  s$ = item_index$(7)
  hnd% = dll_call0("GetActiveControl")
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  s$ = chr$(9)
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  pause 1000
  s$ = item_read$(9,item_index(7))
  sep%=instr(s$,";")
  s$=right$(s$,len(s$)-sep%)
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  pause 1000
  s$ = chr$(9)
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  s$ = chr$(13)
  res% = dll_call2("SendStringAsText",hnd%,adr(s$))
  pause 1000
  show 0
return
' ------------------------------------------------------------------------------
Close0:
  dll_off
return
' ------------------------------------------------------------------------------
Quitter:
terminate
This program needs KGF.dll

You can download KGF.dll here :https://skydrive.live.com/redir?resid=87F49C411AB42B1D!167&authkey=!AMVK_AxIqSL4u2A
Back to top Go down
View user profile
 
Connect to Mydrive
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Could not start Selenium session: Connection timed out: connect
» unable to connect the IWebdriver app to the local network
» Unable to connect to host 127.0.0.1 on port 7055
» could not connect to selenium rc server
» [SOLVED] Can't connect to updates server???

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: