|
Thankx for the help, i got it.
Jats
|
|
|
|
|
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
|
|
|
|
|
Hi
How do you overwrite bytes in a certain position in a file in VB.Net/VS2003.
|
|
|
|
|
This is covered by the FileStream[^] class. You usually open the file, Seek to the position you want to overwrite, then Write the new data.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
What type of file is this? If it is text, you dont have a choice but to read out the whole file, change the characters that you want to, and write it all out again.
|
|
|
|
|
Hi
It is a midi file...
The header is mixed as follows:
A 4-byte chunk type (ascii)
A 4-byte length (32 bits, msb first)
length bytes of data
(I will only be able to check if you reply in the morning)
|
|
|
|
|
RichardBerry wrote: It is a midi file...
The header is mixed as follows:
A 4-byte chunk type (ascii)
A 4-byte length (32 bits, msb first)
length bytes of data
In that case, please look at Dave's suggestion above.
Keep in mind that the number of bytes you want to write should match the number you are overwriting, though
|
|
|
|
|
hi everybody,
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.
Thanx in advance.
|
|
|
|
|
Without seeing your function header, it's impossible to tell. You might want to ask this question in the C++ forums.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi
How do you rename a file in vb.net?
(I don't ewant to open the file and Save it as osmething else - just rename)
|
|
|
|
|
Try this:
Imports System.IO
File.Move(oldfilename, newfilename)
NOTE you need to include the path in the filenames above.
Hope that helps.
Ben
|
|
|
|
|
Works perfectly - Thanks!!!
|
|
|
|
|
Hello All,
Can I use declare API function in vbscript file and use that function via wrapper function
Develop2Program & Program2Develop
|
|
|
|
|
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
|
|
|
|
|
Dave Kreskowiak wrote: No. VBScript, thankfully, has no facility to call the Win32 API directly.
I don't agree. A COM wrapper to Win32 could be handy to have some fun scripting.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: I don't agree.
I sure as **** don't want someone having fun at my expense. I want to have fun at theirs!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: I sure as **** don't want someone having fun at my expense. I want to have fun at theirs!
I never asked you to build up such a wrapper...
BTW, Could you, please, build it for us?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
OK, now you're startin' to sound like your serious. You're creepin' me out man!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hello
how can i search for information that is in access and display it in datagrid
|
|
|
|
|
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 all
i need help......
i have one column in the database viz type its rows are like as fol
level1-type1
level1-type2
level1-type3
level1-type4
level2-type1
level2-type2
level2-type3
level2-type4
i need do display in the flexgrid in the foll form
level1
type1 - some data
type2 - some data
type3 - some data
type4 - some data
level2
type1 - some data
type2 - some data
type3 - some data
type4 - some data
plz help ....
thanks in advance...
|
|
|
|
|
devkranth wrote: have one column in the database
Then you need to normalise the data into two columns.
|
|
|
|
|
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
step 1:
Declare the Connection object
And the Recordset
step2:
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 .
Thanks
Dim rS As New ADODB.Recordset
Vuyiswa
|
|
|
|
|
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.
http://www.carlprothman.net/Default.aspx?tabid=81
hope it helps
There are 10 types of people in the world: those who understand binary and those who don't
|
|
|
|
|
i need VB6 Connection string
Vuyiswa
|
|
|
|