Question Help with WebBrowser to replace http file request

MikiMiki12

New member
Joined
Sep 19, 2013
Messages
1
Programming Experience
Beginner
Is there anyway to set when browser request some file
to load another file.


If URI matches...
http://www.xxx.com/scripts/file.swf
then respond with...
http://www.xxx.com/scripts/file2.swf


i do this now with Fiddler - The Free Web Debugging Proxy by Telerik
404


i don't know how to explain
please see this picture
http://i.imgur.com/evBRHpm.jpg


but want to make webbrowser in VB to do this automatic..


VB.NET:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Dim url As String = WebBrowser1.Url.ToString


        If url = "http://www.xxx.com/scripts/file.swf" Then
            WebBrowser1.Navigate("http://www.xxx.com/scripts/file2.swf")
        End If


    End Sub
i try this code but this code is only for main url i need it for server request.




another explanation


let's say that this index of Example Domain


VB.NET:
<!DOCTYPE html>
<html>
<body>


<object width="400" height="40"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
<param name="SRC" value="bookmark.swf">
<embed src="bookmark.swf" width="400" height="40"></embed>
</object>


</body>
</html>


Now when i open Example Domain in my webbrowser it will request this file to load (bookmark.swf) but i don't want to load that file i want to load bookmark2.swf file.
Do you understand me ?




it can be also with image


VB.NET:
<html>
<body>
<img src="boat.gif">
</body>
</html>


now when i open Example Domain in webbrowser it need to check if html need this file boat.gif and if , than load boat2.gif.
i think now someone will understand me what i want
 
Just to confirm, you're talking about only in a WebBrowser control in your own application, right; not in the user's default web browser? Can I ask why you would want to do this?
 
Back
Top