Petr Manek,
I noticed that you modified your question post four times. It seems that you are serious on this problem. I don't know whether you're familiar with the vbscript or javascript because it is possible that you close the browser's cookie and the server's session by the script code in your project.
Have you tried to search some functions in code project or msdn? If there is not proper functions or methods to realize your WebBrowser functions, I suggest you to try some scripts.
Hope that you can find a best solution.
I searched codeproject.com and I have found this: The tiny wrapper class for URL history interface in C# - The Code Project - C# Programming. But I don't know how can I implement it to my code...
Here's my source code of my WebBrowser control form:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function DeleteRegistryKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Dim Customizer As WBCustomizer
Const navNoHistory = 2
Private Sub Form_Load()
On Error Resume Next
Form_Resize
Dim sBuffer As String
Dim sBuffer2 As String
Dim lSize As Long
Dim lSize2 As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
sBuffer2 = Space$(255)
lSize2 = Len(sBuffer2)
Call GetUserName(sBuffer, lSize)
Call GetComputerName(sBuffer2, lSize2)
Set Customizer = New WBCustomizer
With Customizer
.EnableContextMenus = False
.EnableAllAccelerators = True
Set .WebBrowser = brwWebBrowser
End With
brwWebBrowser.Navigate2 "http://MySecretWebsite.com/WorkStationAttempt.aspx?Computer=" & Left$(sBuffer2, lSize2) & "&LoggedUser=" & Left$(sBuffer, lSize), navNoHistory
brwWebBrowser.SetFocus
End Sub
Private Sub Form_Resize()
On Error Resume Next
brwWebBrowser.Width = Me.ScaleWidth
brwWebBrowser.Height = Me.ScaleHeight
End Sub
Petr Manek,
Did you try to add a reference for your .NET project? Or add the dll in the Toolbox to make it like a control.
Petr Manek,
The DLL file I suggested you to add as a reference is compiled by VB6 and when you would like to use it, you should firstly register in your .NET Framework. As a control that can be used, the file is actually a ocx file, use the "regsvr32 FileName.ocx" can help you to register on other computer to use.
I suggest you to have a look at the related information on COM Interop and P/Invoke knowledge, then you can totally understand the COM and help you to know better on .NET Framework.