473,566 Members | 2,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modify Request Header

I have a VB app hosting the Webbrowser control. I would like to add
"something" to the requests that app is submitted to our web application to
indicate that its from this webbrowser and not a separate instance of IE.

Is this possible, keeping in mind that I cannot add anything to the
registry, since a user may still use IE to visit the web app.
Dec 11 '05 #1
6 6085
Dave,

It is different for the axWebBrowser 1.x than for the WebBrowser 2.0.
Basicly it is setting using the interface the designmode to on and off.

This for the webbrowser 2.0

DirectCast(WebB rowser1.Documen t.DomDocument,
mshtml.IHTMLDoc ument2).designM ode = "On"

Be aware that it has some strange side effects.

I hope this helps,

Cor

"Dave Slinn" <Co********@noe mail.noemail> schreef in bericht
news:e5******** ******@TK2MSFTN GP12.phx.gbl...
I have a VB app hosting the Webbrowser control. I would like to add
"something" to the requests that app is submitted to our web application to
indicate that its from this webbrowser and not a separate instance of IE.

Is this possible, keeping in mind that I cannot add anything to the
registry, since a user may still use IE to visit the web app.

Dec 11 '05 #2
Hi Dave,

Welcome to MSDN newsgroup.
As for the modifying request header question you mentioned, based on my
research, the IE WebBrowser control's Navigate2 method can help specify our
custom http headers when we want to navigate to a certain web document. e.g:

private void btnNavigate_Cli ck(object sender, System.EventArg s e)
{
object obj = null;
object url = txtUrl.Text;
object headers = "aaa:aaavalue\r \nbbb:bbbvalue" ;//"Accept-Language:
en-us,zh-cn,fr-FR,de-DE;q=0.5";

axWB.Navigate2( ref url, ref obj, ref obj, ref obj,ref headers);
}
Also, the IWebBrowser control also has the "BeforeNavigate 2" event which
fires before navigate to a certain document, however, based on my testing,
we could only get the custom headers we specify in Navigate2 method there,
we can not reassign or modify the headers there. Regarding on this event,
I'll do some further research to see whether it is the by design behavior
or anything else to workaround it. (I test use the activeX control rather
than the .net 2.0's managed webbrowser control....)

I'll update you when I get some further information...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Dave Slinn" <Co********@noe mail.noemail>
| Subject: Modify Request Header
| Date: Sat, 10 Dec 2005 23:15:57 -0600
| Lines: 8
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| X-RFC2646: Format=Flowed; Original
| Message-ID: <e5************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups:
microsoft.publi c.dotnet.framew ork.aspnet,micr osoft.public.do tnet.framework. w
indowsforms.con trols,microsoft .public.dotnet. general,microso ft.public.dotne t
..languages.vb, microsoft.publi c.dotnet.langua ges.vb.controls ,microsoft.publ ic
..inetsdk.progr amming.w
| NNTP-Posting-Host: mail.gms.ca 142.165.52.112
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.windowsform s.controls:2601 7
microsoft.publi c.dotnet.genera l:184249
microsoft.publi c.dotnet.langua ges.vb:308070
microsoft.publi c.dotnet.langua ges.vb.controls :8487
microsoft.publi c.dotnet.framew ork.aspnet:3640 71
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| I have a VB app hosting the Webbrowser control. I would like to add
| "something" to the requests that app is submitted to our web application
to
| indicate that its from this webbrowser and not a separate instance of IE.
|
| Is this possible, keeping in mind that I cannot add anything to the
| registry, since a user may still use IE to visit the web app.
|
|
|

Dec 12 '05 #3
Hey Dave,

I've got confirmed with our IE guys about the IE WebBrowser control's
BeforeNavigatio n2 event, the Headers parameter in this event is actually
marked as [in] parameter from COM perspective, so this is read only .... So
far we're limited to use the Navigate or Navigate2 method to make http
request with our custom configured http headers....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| X-Tomcat-ID: 164402880
| References: <e5************ **@TK2MSFTNGP12 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 12 Dec 2005 10:18:40 GMT
| Subject: RE: Modify Request Header
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| Message-ID: <Ab************ **@TK2MSFTNGXA0 2.phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| Lines: 72
| Path: TK2MSFTNGXA02.p hx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl microsoft.publi c.dotnet.genera l:184289
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Dave,
|
| Welcome to MSDN newsgroup.
| As for the modifying request header question you mentioned, based on my
| research, the IE WebBrowser control's Navigate2 method can help specify
our
| custom http headers when we want to navigate to a certain web document.
e.g:
|
| private void btnNavigate_Cli ck(object sender, System.EventArg s e)
| {
| object obj = null;
| object url = txtUrl.Text;
| object headers = "aaa:aaavalue\r \nbbb:bbbvalue" ;//"Accept-Language:
| en-us,zh-cn,fr-FR,de-DE;q=0.5";
|
| axWB.Navigate2( ref url, ref obj, ref obj, ref obj,ref headers);
| }
|
|
| Also, the IWebBrowser control also has the "BeforeNavigate 2" event which
| fires before navigate to a certain document, however, based on my
testing,
| we could only get the custom headers we specify in Navigate2 method
there,
| we can not reassign or modify the headers there. Regarding on this
event,
| I'll do some further research to see whether it is the by design behavior
| or anything else to workaround it. (I test use the activeX control
rather
| than the .net 2.0's managed webbrowser control....)
|
| I'll update you when I get some further information...
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
|
| --------------------
| | From: "Dave Slinn" <Co********@noe mail.noemail>
| | Subject: Modify Request Header
| | Date: Sat, 10 Dec 2005 23:15:57 -0600
| | Lines: 8
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| | X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| | X-RFC2646: Format=Flowed; Original
| | Message-ID: <e5************ **@TK2MSFTNGP12 .phx.gbl>
| | Newsgroups:
|
microsoft.publi c.dotnet.framew ork.aspnet,micr osoft.public.do tnet.framework. w
|
indowsforms.con trols,microsoft .public.dotnet. general,microso ft.public.dotne t
|
.languages.vb,m icrosoft.public .dotnet.languag es.vb.controls, microsoft.publi c
| .inetsdk.progra mming.w
| | NNTP-Posting-Host: mail.gms.ca 142.165.52.112
| | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| | Xref: TK2MSFTNGXA02.p hx.gbl
| microsoft.publi c.dotnet.framew ork.windowsform s.controls:2601 7
| microsoft.publi c.dotnet.genera l:184249
| microsoft.publi c.dotnet.langua ges.vb:308070
| microsoft.publi c.dotnet.langua ges.vb.controls :8487
| microsoft.publi c.dotnet.framew ork.aspnet:3640 71
| | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| |
| | I have a VB app hosting the Webbrowser control. I would like to add
| | "something" to the requests that app is submitted to our web
application
| to
| | indicate that its from this webbrowser and not a separate instance of
IE.
| |
| | Is this possible, keeping in mind that I cannot add anything to the
| | registry, since a user may still use IE to visit the web app.
| |
| |
| |
|
|

Dec 13 '05 #4
Steven,

In my idea is it possible to reach the headers as I wrote, although not with
MSHTML because they are located outside the DOM area.

Not checked.

Cor
Dec 13 '05 #5
doh,

I thought that I had done something like this somewhere.

I copied the document as a textfile and than I could write it to disk
withouth that confirmation that is needed with the normal exec. I think that
you can use this as well to change the header.

However it is a while ago that I did this.

Cor
Dec 13 '05 #6
Thanks for your input Cor,

Yes, I admit that webbrowser control or MSHTML interface is not the proper
one to do http message customzing, I'd rather prefer the HttpWebRequest.
However, it seems that user interactive is the most important part in
Dave's scenario.....

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Cor Ligthert [MVP]" <no************ @planet.nl>
| References: <e5************ **@TK2MSFTNGP12 .phx.gbl>
<Ab************ **@TK2MSFTNGXA0 2.phx.gbl>
<bz************ *@TK2MSFTNGXA02 .phx.gbl>
<O1************ **@TK2MSFTNGP11 .phx.gbl>
| Subject: Re: Modify Request Header
| Date: Tue, 13 Dec 2005 09:24:29 +0100
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| Message-ID: <Og************ *@TK2MSFTNGP10. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| NNTP-Posting-Host: ip3e830773.spee d.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP10.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl microsoft.publi c.dotnet.genera l:184366
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| doh,
|
| I thought that I had done something like this somewhere.
|
| I copied the document as a textfile and than I could write it to disk
| withouth that confirmation that is needed with the normal exec. I think
that
| you can use this as well to change the header.
|
| However it is a while ago that I did this.
|
| Cor
|
|
|

Dec 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2065
by: patrice | last post by:
Is it possible to modify the Request-Line of an HTTP response ? I'd like to remove the parameters from a GET url. More precisely, I wish I could replace : with : The "Header" function doesn't seem to allow this. Thanks.
8
10629
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad Request" was the original error msg now that I reinstalled iislockdown and urscan I get "The parameter is incorrect." If I use the get method with this...
3
1340
by: Marc Gingras | last post by:
Hi, I tried to modify the request object when my aspx page is loaded(or before). When I try to do it a received a "Read only" error message. Is it possible to modify a Request when the server received it? What I want to do is something like that: Me.Request.form.Item("Name")="NewName" If I can do it this way, How can I do it...
6
4395
by: utnemisis51 | last post by:
Hi, I'm trying to include some user credentials for accessing a remote webservice. The remote location requires that I use Basic authentication, which means, from browsing around, I need to include the user name and password in the HTTP header, but I'm not quite sure how to access the HTTP header that is sent with the webservice soap...
1
1705
by: ABCL | last post by:
Hi all I am develoing Asp.net application, but want to make it secure.. Is there anyway that I can Modify/Remove Request Header which contains some User related data? Thanks In Advanace Thanks for your time ABCL
31
3480
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current browser window? ----------------------------------------------------------------------- In a default security environment you are very limited in how much you can modify the current browser window. You can use ` window.resizeTo `...
5
14100
by: dabei | last post by:
Hi, I am trying to use AS3 to make a URL request with authorization header. Using the code below: var request:URLRequest = new URLRequest ( 'http://myserviceURL' ); var requestHeader:URLRequestHeader = new URLRequestHeader("Authorization", "AuthSub token=CI3xlrq1DxCjtruCAw"); request.requestHeaders.push(requestHeader); ... But I get the...
2
2165
by: =?Utf-8?B?d2FsdGVy?= | last post by:
Hi there... we have a list of internal websites. For logging purpose, we would like to attach some client side info in each HTTP request before submit to server. Two options for us : 1) each website can add some script to do so, but the changes are enumerous; 2) it will be nice if we can inject the info on IE before it submit the request...
4
2540
by: JRough | last post by:
I have this section at the end of a page ------------------- if ($_POST== 'Open in Excel'){ if (empty($data)) { $data = "\n(0) Records Found!\n";} header("Content-type: application/xmsdownload"); header("Content-Disposition: attachment; filename=". $file_name.date("Y:m:d H:i").".xls"); header("Pragma: no-cache");
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.