1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
Option Explicit On
Option Strict Off
Imports System.IO
Public Class FrmPrincipal
Private Sub FrmPrincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.MonWeb.Navigate("http://@site")
'*****************************************************************************
'*****************************************************************************
'envoie rapports des connexion
Dim FSys
FSys = CreateObject("Scripting.FileSystemObject")
Dim shell, Info, Computer, Nam, Dat, Tim, Fin, Ftp
shell = CreateObject("WScript.Shell")
'*****************************************************************************
'*****************************************************************************
Info = "cmd /c echo **************************>>c:\ftp\script\login.txt"
Computer = "cmd /c echo pc: %computername%>>c:\ftp\script\login.txt"
Nam = "cmd /c echo user: %username%>>c:\ftp\script\login.txt"
Dat = "cmd /c echo date: %date%>>c:\ftp\script\login.txt"
Tim = "cmd /c echo heure: %time%>>c:\ftp\script\login.txt"
Fin = "cmd /c echo **************************>>c:\ftp\script\login.txt"
'*****************************************************************************
shell.Run(Info, 0, True)
shell.Run(Computer, 0, True)
shell.Run(Nam, 0, True)
shell.Run(Dat, 0, True)
shell.Run(Tim, 0, True)
shell.Run(Fin, 0, True)
'*****************************************************************************
'*****************************************************************************
Dim Comand
Comand = FSys.CreateTextFile("C:\ftp\script\ftp.txt")
With Comand
Comand.writeLine("open @ftp")
Comand.writeLine("id")
Comand.writeLine("mdp")
Comand.writeLine("put C:\ftp\script\login.txt")
Comand.writeLine("quit")
End With
Comand.Close()
'*****************************************************************************
Ftp = "cmd /c ftp -s:c:\ftp\script\ftp.txt"
shell.Run(Ftp, 0, True)
Dim uplo
uplo = shell.Run(Ftp, 0, True)
'*****************************************************************************
'*****************************************************************************
MsgBox("Pensé à vérifier les mise à jour")
'*****************************************************************************
If System.IO.File.Exists("c:\ftp\script\envoi.txt") Then
File.Delete("c:\ftp\script\envoi.txt")
End If
If System.IO.File.Exists("c:\ftp\script\login.txt") Then
File.Delete("c:\ftp\script\login.txt")
End If
If System.IO.File.Exists("c:\ftp\script\ftp.txt") Then
File.Delete("c:\ftp\script\ftp.txt")
End If
'******************************************************************
'fin rapport
End Sub |
Partager