Sincere-Advisor
New Member
The following sub creates an object that check if an NT domain user & password are correct. This runs in ASP fine, however having converted it to .net, I am unable to try multiple conntections because the object still appears to exist. Any ideas on how to kill it once I have created it, since it wont appear to die for about 5mins?<BR><BR><BR>Sub Button1_Click(Sender As Object, E As EventArgs)<BR><BR>on error resume next <BR> <BR>Dim strNTDomain As String = "WEBPLATFORMS"<BR>Dim strUsername As String = username.value<BR>Dim strPassword As String = password.value<BR>Dim ADS_SECURE_AUTHENTICATION As Integer = 1<BR> <BR><BR>Dim objIADS As Object = GetObject("WinNT:").OpenDSObject("WinNT://" & strNTDomain, strUsername, strPassword, ADS_SECURE_AUTHENTICATION)<BR>objIADS = Nothing<BR> Err.number <> 0 then<BR> incorrect.text = "ERROR: " & Err.Description<BR> Else<BR> response.redirect ("welcome.aspx?username=" & username.value)<BR> End If<BR> <BR>End SubGot given the answer on another forum, however, if anyones interested, the problem is that you cannot control the length of time a com object exist easily..<BR><BR>The answer I was given is to add the following<BR><BR><%@ namespace="System.Runtime.InteropServices"%><BR>System.Runtime.InteropServices.Marshal.ReleaseComO bject(objIADS)