Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:03:42+00:00 2026-05-13T07:03:42+00:00

I have a c# windows app project which has to open IE, navigate to

  • 0

I have a c# windows app project which has to open IE, navigate to a website, login and then upload a few files.

I used shDocvW and mshtml libraries to do this. I am able to open IE, navigate to the website and login but am not able to upload the files.

I am able to navigate to the website and then add a text value to the input fields(This is an input field of type “text”) on the website using –

HTMLInputElement txtbox1 =(HTMLInputElement)oDoc.all.item("login", 0);
txtbox1.value = "Login_name";

I also was similarly able to even add a text value to the input field of type “password”. After I logged in to the website, I have to upload a file.

The problem I am facing is that I am not able to add the path(a string) to the input field of type “file”.

I am not able to find any solutions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:03:43+00:00Added an answer on May 13, 2026 at 7:03 am

    I tried many ways to do this but it was not possible because IE8 made the Value property of read-only for security reasons.

    Well, I did find a work around. It is very simple but the use of SendKeys is not always considered the best programming solution. But, it does the job.

    oBrowser.Navigate("http://www.some-url.com", ref oNull, ref oNull, ref oNull, ref oNull);        
    
    while (oBrowser.Busy)   
    {
        System.Threading.Thread.Sleep(20);
    }
    
    //Locate the Input element of type="file"
    HTMLInputElement file_1 = (HTMLInputElement)oDoc.all.item("file_1", 0);
    file_1.select();        
    
    SendKeys.Send("{TAB}");   //Navigate to the Browse button
    SendKeys.Send(" ");       //Click on the browse button
    
    SendKeys.Send(@"c:\Test.txt");         //File Path
    SendKeys.Send("{TAB}");
    SendKeys.Send("{ENTER}");
    

    This code can be bettered by checking for the active window and perhaps setting the correct one before every SendKeys command. This can be done by using the FindWindow() and FindWindowEx() of user32.dll. These methods in the windows API are used to find the active window and the child windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 252k
  • Answers 252k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's hard to give a precise answer as you didn't… May 13, 2026 at 9:44 am
  • Editorial Team
    Editorial Team added an answer You will need to bind your autocompletebox's ItemsSource to your… May 13, 2026 at 9:44 am
  • Editorial Team
    Editorial Team added an answer There's a bug in the WSDL. The final part in… May 13, 2026 at 9:44 am

Related Questions

I have a c# windows form app in which we did a rapid prototype
I have a Windows application in .Net 2.0 that uses several levels of configuration
I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess
C# question here.. I have a UTF-8 string that is being interpreted by a
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.