Click here to Skip to main content
16,017,015 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to close an application completely Pin
Dave Kreskowiak2-May-07 4:47
mveDave Kreskowiak2-May-07 4:47 
QuestionNeed Help with Outlook [modified] Pin
Jats_4ru2-May-07 3:08
Jats_4ru2-May-07 3:08 
AnswerRe: Need Help with Outlook Pin
RichardBerry2-May-07 3:40
RichardBerry2-May-07 3:40 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 4:23
Jats_4ru2-May-07 4:23 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 4:31
Jats_4ru2-May-07 4:31 
AnswerRe: Need Help with Outlook Pin
Rupesh Kumar Swami2-May-07 4:10
Rupesh Kumar Swami2-May-07 4:10 
GeneralRe: Need Help with Outlook Pin
Jats_4ru2-May-07 4:32
Jats_4ru2-May-07 4:32 
QuestionHow to keep the sessions using web request Pin
vurugonda2-May-07 3:00
vurugonda2-May-07 3: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 2:42
RichardBerry2-May-07 2:42 
AnswerRe: How do you overwrite bytes in a certain position in a file Pin
Dave Kreskowiak2-May-07 3:45
mveDave Kreskowiak2-May-07 3:45 
AnswerRe: How do you overwrite bytes in a certain position in a file Pin
ChandraRam2-May-07 4:27
ChandraRam2-May-07 4:27 
GeneralRe: How do you overwrite bytes in a certain position in a file Pin
RichardBerry2-May-07 4:51
RichardBerry2-May-07 4:51 
GeneralRe: How do you overwrite bytes in a certain position in a file Pin
ChandraRam2-May-07 7:37
ChandraRam2-May-07 7:37 
QuestionHow to call a function from c++ dll in VB Pin
sandeepkavade2-May-07 2:41
sandeepkavade2-May-07 2:41 
AnswerRe: How to call a function from c++ dll in VB Pin
Dave Kreskowiak2-May-07 3:41
mveDave Kreskowiak2-May-07 3:41 
QuestionHow do you rename a file - Without opening and save as Pin
RichardBerry2-May-07 2:41
RichardBerry2-May-07 2:41 
AnswerRe: How do you rename a file - Without opening and save as Pin
kubben2-May-07 3:08
kubben2-May-07 3:08 
GeneralRe: How do you rename a file - Without opening and save as Pin
RichardBerry2-May-07 3:25
RichardBerry2-May-07 3:25 
QuestionUsing API in VBscript Pin
Navneet Hegde2-May-07 2:21
Navneet Hegde2-May-07 2:21 
AnswerRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 3:38
mveDave Kreskowiak2-May-07 3:38 
GeneralRe: Using API in VBscript Pin
CPallini2-May-07 4:29
mveCPallini2-May-07 4:29 
GeneralRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 4:50
mveDave Kreskowiak2-May-07 4:50 
GeneralRe: Using API in VBscript Pin
CPallini2-May-07 5:08
mveCPallini2-May-07 5:08 
GeneralRe: Using API in VBscript Pin
Dave Kreskowiak2-May-07 8:06
mveDave Kreskowiak2-May-07 8:06 
Questionfind infomation and display it in datagrid Pin
detective_girl2-May-07 1:56
detective_girl2-May-07 1: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.