0

Hello I have problem with select file to upload in a WebBrowser, I try do this like that:

var elements = webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement file in elements)
{
    if (file.GetAttribute("type") == "file")
    {
        file.Focus();
        file.InvokeMember("click");
        Thread.Sleep(2000);
        IntPtr fileDownloadDialogPointer = FindWindow(null, "select file dialog");
        SetForegroundWindow(fileDownloadDialogPointer);
        //SendKeys.SendWait("text");

        InputSimulator.SimulateTextEntry("text");
        }
    }

but this isnt working. How to fix it? I want to insert text in field in Select File Dialog.

Fᴀʀʜᴀɴ Aɴᴀᴍ
  • 6,131
  • 5
  • 31
  • 52
Nordin
  • 1
  • 2

0 Answers0