Click here to Skip to main content
14,774,693 members
Home » Discussions » Visual Basic
   

Visual Basic

 
GeneralRe: How to close an application completely Pin
Dave Kreskowiak2-May-07 5:47
mveDave Kreskowiak2-May-07 5:47 
QuestionNeed Help with Outlook [modified] Pin
Jats_4ru2-May-07 4:08
MemberJats_4ru2-May-07 4:08 
AnswerRe: Need Help with Outlook Pin
RichardBerry2-May-07 4:40
MemberRichardBerry2-May-07 4:40 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 5:23
MemberJats_4ru2-May-07 5:23 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 5:31
MemberJats_4ru2-May-07 5:31 
AnswerRe: Need Help with Outlook Pin
Rupesh Kumar Swami2-May-07 5:10
MemberRupesh Kumar Swami2-May-07 5:10 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 5:32
MemberJats_4ru2-May-07 5:32 
QuestionHow to keep the sessions using web request Pin
vurugonda2-May-07 4:00
Membervurugonda2-May-07 4:00 
Hi
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........................

thxadvance


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim query As String = "email=sams@sdd.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)

WebBrowser1.Navigate(url3)
End Sub
Public Function getpage(ByVal strurl As String) As String
Dim responseData As String = ""
Dim responseReader As StreamReader
Try
webRequest1 = WebRequest.Create(strurl)
webRequest1.Timeout = 30000
webRequest1.Method = "GET"
responseReader = New StreamReader(webRequest1.GetResponse.GetResponseStream)
responseData = responseReader.ReadToEnd
responseReader.Close()
Catch ex As Exception
MessageBox.Show(ex.Message.ToString, "vcv", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Return responseData
End Function
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
Try
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(strpost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try

Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
WebBrowser1.Navigate(url1)
sr.Close()
Return result
End Function

QuestionHow do you overwrite bytes in a certain position in a file Pin
RichardBerry2-May-07 3:42
MemberRichardBerry2-May-07 3:42 
AnswerRe: How do you overwrite bytes in a certain position in a file Pin
Dave Kreskowiak2-May-07 4:45
mveDave Kreskowiak2-May-07 4:45 
AnswerRe: How do you overwrite bytes in a certain position in a file Pin
ChandraRam2-May-07 5:27
MemberChandraRam2-May-07 5:27 
GeneralRe: How do you overwrite bytes in a certain position in a file Pin
RichardBerry2-May-07 5:51
MemberRichardBerry2-May-07 5:51 
GeneralRe: How do you overwrite bytes in a certain position in a file Pin
ChandraRam2-May-07 8:37
MemberChandraRam2-May-07 8:37 
QuestionHow to call a function from c++ dll in VB Pin
sandeepkavade2-May-07 3:41
Membersandeepkavade2-May-07 3:41 
AnswerRe: How to call a function from c++ dll in VB Pin
Dave Kreskowiak2-May-07 4:41
mveDave Kreskowiak2-May-07 4:41 
QuestionHow do you rename a file - Without opening and save as Pin
RichardBerry2-May-07 3:41
MemberRichardBerry2-May-07 3:41 
AnswerRe: How do you rename a file - Without opening and save as Pin
kubben2-May-07 4:08
Memberkubben2-May-07 4:08 
GeneralRe: How do you rename a file - Without opening and save as Pin
RichardBerry2-May-07 4:25
MemberRichardBerry2-May-07 4:25 
QuestionUsing API in VBscript Pin
Navneet Hegde2-May-07 3:21
MemberNavneet Hegde2-May-07 3:21 
AnswerRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 4:38
mveDave Kreskowiak2-May-07 4:38 
GeneralRe: Using API in VBscript Pin
CPallini2-May-07 5:29
mveCPallini2-May-07 5:29 
GeneralRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 5:50
mveDave Kreskowiak2-May-07 5:50 
GeneralRe: Using API in VBscript Pin
CPallini2-May-07 6:08
mveCPallini2-May-07 6:08 
GeneralRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 9:06
mveDave Kreskowiak2-May-07 9:06 
Questionfind infomation and display it in datagrid Pin
detective_girl2-May-07 2:56
Memberdetective_girl2-May-07 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.