VB.NET中的变量是否仅在本地共享函数?

时间:2016-12-18 21:26:58

标签: asp.net ajax vb.net

ASP.NET VB.NET 3.5。

在以下函数中,从网页AJAX调用,cVSession2对象是否会与其他用户共享(我不希望它)?

 <WebMethod()> _
   Public Shared Function fGPSUpdateSessionValues(ByVal strLatitude As String, ByVal strLongitude As String) As String

        Dim strReturn As String = ""

        Dim cVSession2 As New cVSession
        With cVSession2
            .pVSessionGPSLatitudeLastPosition = strLatitude
            .pVSessionGPSLongitudeLastPosition = strLongitude
            .fUpdate()
        End With

        cVSession2 = Nothing

        Return strReturn

    End Function

1 个答案:

答案 0 :(得分:0)

根据以下内容,cVSession2等局部变量似乎不会与其他用户共享:

Does a static method share its local variables & what happens during concurrent usage from different threads?