简体   繁体   中英

How to load content of website as mobile web browser in my winform web browser C#

I have made a web browser in C#, but i want an option like use as a mobile browser , like which contents of websites will load as mobile browser like if at that moment user browses www.facebook.com it will automatically go to m.facebook.com such as our mobile phone browsers does.

I can make this by replacing www to m by String Changing but some other sites like blogspot sites has two different views for mobile and web in one domain of {myblog}.blogspot.com

So for these cases, is it possible to load contents as mobile browser in my winform web browser {im using C#}

EDIT: I meant something like User Agent

Try this :

webBrowser.Navigate("http://localhost/run.php", null, null,
                string.Format("User-Agent: {0}", "Opera/9.80 (J2ME/MIDP; Opera Mini/9 (Compatible; MSIE:9.0; iPhone; BlackBerry9700; AppleWebKit/24.746; U; en) Presto/2.5.25 Version/10.54"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM