문제

I have a problem sending postData while user click on button on some webpage. It means that postData cannot be Null. Here is the code:

webBrowser1.Navigate(e.Url, "_self", default(byte[]), headers);

As you can see I've used default(byte[]) for postData overload, but this is not working. What I'm trying to do is NOT to change post data, just headers.

Edit: I do this like this:

private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
                .
                .
                .    
                webBrowser1.Navigate(e.Url, "_self", default(byte[], headers);

                .
                .
                . 
        }

When the browser is navigating I add headers. This works, but when user press on some button or writes username and password into login forum and press submit, it doesn't work.

도움이 되었습니까?

해결책

Just pass empty byte array. default of array is null, because arrays are reference type.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top