Solved

I'm writing a vb.net client that will navigate a web site by populating the controls. One of the pages accepts both text box data AND requires a file to be uploaded.

Posted on 2006-07-06
7
225 Views
Last Modified: 2010-04-23
In VB.NET how can I update a multipart form to contain both text and a file to be uploaded to a web site. I have no control over the website.
0
Comment
Question by:lrygiel
  • 4
  • 3
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17055258
What is the web site?

Bob
0
 
LVL 4

Author Comment

by:lrygiel
ID: 17058234
It is a state judicial web site whihc allows electronic filing of documents. I am at a roadblock at the actual upload filing page. It has a multipart form (created via java scriptlets) containg several file controls and several other controls (text, check box). all wich need to be populated.

So I need to populate the text and check  boxes as well as upload the file. Ideas?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17058785
I have used a WebBrowser control to pull up the page, get references to the controls, fill in data, click buttons.

Bob
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Author Comment

by:lrygiel
ID: 17059215
Hi Bob,

Are you refering to the old INET control or old web browser control or is  there anything new in .net that is available?

Can you provide an example of the code which will do this?

Lee
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17059299
1) .NET version?

2) Yes, the WebBrowser is still a bigger player in the .NET arena.

3) It depends on the web page, as to whether you can interact with it using the WebBrowser control.

4) 2005 has the WebBrowser control as a managed control, but with 2003 you have to add an unmanaged COM control to the project.

Bob
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 17059309
Here is a previous question that should highlight what I mean with 2003:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21846753.html

Bob
0
 
LVL 4

Author Comment

by:lrygiel
ID: 17122650
Bob,

Sorry for the delay in getting back to you, I had another crisis to resolve. Thanks for the help, we are on the right track.

This is .NET 1.1.


I used the WebBroswer control only to discover that the FILE control is a READONLY object. However, I did some further searching and found that giving focus to the control and using the SENDKEYS.SEND method, I can bypass the READONLY nature of the control.

I created a class to do this and the code is as follows:

Public Class FCNET
    Public strErrorMsg As String = ""

    Public ReadOnly Property ErrMsg() As String
        Get
            Return strErrorMsg
        End Get
    End Property

    Public Function SetInputValueNET(ByRef vInPut As mshtml.HTMLInputElement, ByVal newValue As String) As Boolean
        vInPut.focus()
        Try
            System.Windows.Forms.SendKeys.Send(newValue)
            System.Windows.Forms.Application.DoEvents()
        Catch ex As Exception
            strErrorMsg = "SendKeys.Send error: " & ex.Message
            Return False
        End Try
        Return True
    End Function
End Class

Seems to do the trick....

Again thanks....

Lee



0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now