I need very urgent this requirement
i have tio implement in my project
I have implemented httpwebrequest through access the web pages
I want to login to home page using webrequest. it successfully logged into the site but it is unable to showing in web browser , it says session expired.
just see below example if have any solution give me reply
very urgent plz........................
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim query As String = "email@example.com&password=regards &commit=Login&loginType=emp"
Dim url2 As String = "sourceurl"
Dim url3 As String = "target / home page url"
Dim src As String = ""
src = readHtmlPage(url2, query, url3)
src = getpage(url3)
Public Function getpage(ByVal strurl As String) As String
Dim responseData As String = ""
Dim responseReader As StreamReader
webRequest1 = WebRequest.Create(strurl)
webRequest1.Timeout = 30000
webRequest1.Method = "GET"
responseReader = New StreamReader(webRequest1.GetResponse.GetResponseStream)
responseData = responseReader.ReadToEnd
Catch ex As Exception
MessageBox.Show(ex.Message.ToString, "vcv", MessageBoxButtons.OK, MessageBoxIcon.Error)
Function readHtmlPage(ByVal url As String, ByVal strpost As String, ByVal url1 As String) As String
Dim result As String = ""
Dim myWriter As StreamWriter
Dim objRequest As HttpWebRequest = WebRequest.Create(url)
objRequest.Method = "POST"
objRequest.ContentLength = strpost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
objRequest.CookieContainer = New CookieContainer
myWriter = New StreamWriter(objRequest.GetRequestStream())
Catch e As Exception
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
i want to call a function from c++ dll. previously it was working fine. but now i have added unicode support to it. it works fine if _UNICODE is not defined in c++ dll. but if i define _UNICODE it gives error that Can't find DLL entry point . what i am missing.
No. VBScript, thankfully, has no facility to call the Win32 API directly. You'll have to write a COM wrapper around the functions you want to use, using either VB.NET or VB6, or whatever else you want, exposing methods and properties to manipulate the data you want. You can then instantiate that class using CreateObject in VBScript.
Dave Kreskowiak Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
You do a query on the database and set the datasource of the grid to be the data. If you try google, there are tons of tutorials that will go over it better than I can in a forum post.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Hi Am newbie, i just join government Department,a Programmer before me, wrote an aplication that used this code.Am not used the way he connected to the Database, he was using VB6 and am using VB6 too, so i have to built a new application or maintain this one, there was no documentation for his application. Am use use to the Following Step , please tell me is it safe and worth it to continue with it or should i use this guy's connection style
Declare the Connection object
And the Recordset
In the Form load initialize the connection object and recordset, set the cursor type, location and lock type, provider="SQLOLEDB", connectionstring,open the connection, populate, after job done closed connection. all this Accomplished with ADo. Please give me Advices and link to site so i can read more .
I'm not sure if you should maintain or rewrite the application (although with no documentation it might be tricky to maintain) but I do have a link to a list of ways to connect to various types of databases.