[VB2005] Variable globale
Bonjour,
Voici un extrait de mon web service:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class monWebservice
Inherits System.Web.Services.WebService
Dim numInv As Integer = 1
<WebMethod()> Public Sub setNumInv(ByVal maVar As Integer)
_numInv = maVar
End Sub
<WebMethod()> Public Function infos() As String
Return "numInv: " & _numInv
End Function
... |
Et un extrait de mon application:
Code:
1 2 3 4 5 6 7
| Public Class frmMain
Dim wsInv As New monServeur.monWebservice()
Private Sub btnFaireFic_Click(...)
wsInv.setNumInv(3)
msgBox(wsInv.infos)
End Sub
... |
Ca me retourne "numInv: 1" alors que je l'aie initialisée à 3 juste avant.
Qu'est ce qu'il se passe ?
Comment faire une variable globale propre à chaque client ?
Merci d'avance.