I want to display the html of webpages without using webBrowser class in C#.I don't know how to display the http response in windows form
You can consider an open source library, "HTML Renderer" for displaying HTML contents on your winforms. Its available at Codeplex.
http://htmlrenderer.codeplex.com/
BTW any specific reason for not using webBrowser?
i search information how to add video from youtube, example:
I want add video from some youtube link.
I think that it should be in webview, but i need some details, because i can't find any information about my problem.
You can use the webview to play youtube video.
string html=#"<html><body><iframe width=""200"" height=""400"" src=""strUrl""></iframe></body></html>";
var myWebView = ( WebView ) FindViewById ( Resource.Id.myWebView );
var settings=myWebView.Settings;
settings.JavaScriptEnabled=true;
settings.UseWideViewPort=true;
settings.LoadWithOverviewMode=true;
settings.JavaScriptCanOpenWindowsAutomatically=true;
settings.DomStorageEnabled=true;
settings.SetRenderPriority(WebSettings.RenderPriority.High);
settings.BuiltInZoomControls = false;
settings.JavaScriptCanOpenWindowsAutomatically=true;
myWebView.SetWebChromeClient(new WebChromeClient());
settings.AllowFileAccess = true;
settings.SetPluginState(WebSettings.PluginState.On);
myWebView.LoadDataWithBaseURL(null,html,"text/html","UTF-8",null);
Add internet permission in manifest file and enable hardwareAccelerated="true". Follow this my blog entry for more detail : http://appliedcodelog.blogspot.in/2015/09/how-to-play-youtube-video-using-webview.html
Update: Everything below is still correct, but the official YouTube API for Android is now available.
By far, the easiest way to play a YouTube video on Android is to simply fire an Intent to launch the native Android YouTube app. Of course, this will fail if you are not on a certified Google device, that doesn't have the complement of Google apps. (The Kindle Fire is probably the biggest example of such a device). The problem with this approach is that the user will not automatically wind up back at your app when the video finishes; they have to press the Back button, and at this point you've probably lost them.
As a second option, you can use the MediaPlayer API to play YouTube videos. But there are three caveats with this approach:
1) You need to make a call to YouTube's GData webservice API, passing it the ID of the video. You'll get back a ton of metadata, along with it the RTSP URL that you should pass to MediaPlayer to play back an H.264-encoded stream. This is probably the reason why your attempt to use MediaPlayer failed; you probably weren't using the correct URL to stream.
2) The GData/MediaPlayer approach will only play back low-resolution content (176x144 or similar). This is a deliberate decision on the part of YouTube, to prevent theft of content. Of course, this doesn't provide a very satisfactory experience. There are back-door hacks to get higher resolution streams, but they aren't supported on all releases of Android and using them is a violation of YouTube's terms of service.
3) The RTSP streams can be blocked by some internal networks/firewalls, so this approach may not work for all users.
The third option is to embed a WebView in your application. There two approaches you can take here:
1) You can embed a Flash object and run the standard desktop Flash player for YouTube. You can even use the Javascript API to control the player, and relay events back to the native Android app. This approach works well, but unfortunately Flash is being deprecated on the Android platform, and will not work for Android 4.1 and later.
2) You can embed a <video> tag to play YouTube via HTML5. Support for this varies between various releases of Android. It works well on Android 4.0 and later; earlier releases have somewhat spotty HTML5 <video> support. So, depending upon what releases of Android your application must support, you can take a hybrid approach of embedding HTML5 on Android 4.x or later, and Flash for all earlier versions of Android.
There are several threads here on StackOverflow about using HTML5 to play YouTube video; none of them really describe the entire process you must follow in one place. Here's links to a few of them:
Android - How to play Youtube video in WebView?
How to embed a YouTube clip in a WebView on Android
Play Youtube HTML5 embedded Video in Android WebView
All of this will get dramatically easier in the weeks/months to come; at Google I/O 2012, they presented/demoed a new YouTube API for Android that will support direct embedding of YouTube content in your application, with full support back to Android 2.2 (about 95% of the Android userbase as of this writing). It can't arrive fast enough.
Thanks #mportuesisf for this wonderful answer.
Heres some links.
http://docs.xamarin.com/recipes/android/media/video/play_video/
Streaming Youtube Videos
for xamarin forms you can use HtmlWebViewSource
in my VM:
public HtmlWebViewSource VideoSource { get; set; }
in constructor :
VideoSource = new HtmlWebViewSource();
VideoSource.Html = #"<html><body> <div style=' position: relative; padding-bottom: 56.25%; padding-top: 25px;'> <iframe style='position: absolute; top: 0; left: 0; width: 100%; height: 100%;' src='https://www.youtube.com/embed/bVdfj7HXuXE' frameborder='0' allowfullscreen></iframe></div> </body></html>";
in my View :
<WebView VerticalOptions="Fill"
HorizontalOptions="Fill"
Source="{Binding VideoSource}"
/>
firstly you must copy the link above the video youtube when you click on share then choose integrate and select the src of the youtube video
then in your c sharp create :
and you're gonna see the video inside the web view
WebView webview = FindViewById<WebView>(Resource.Id.webView1);
video =("the src of the youtube video");
var uri = Android.Net.Uri.Parse(video);
WebSettings settings = webview.Settings;
settings.JavaScriptEnabled = true;
webview.SetWebChromeClient(new WebChromeClient());
webview.LoadUrl(video);
I'm using the GeckoFX 'GeckoWebBrowser' user control to navigate but I can't play Flash videos of any page, for example if I try to navigate to youtube it always displays this error:
There is a way to enable Flash videos?
UPDATE:
I've set this property:
GeckoPreferences.Default("extensions.blocklist.enabled") = False
...And now the background of the videos are shown but I can't reproduce any video.
About the "Emoticon" who says that this video is unaivailbe : this is because the page is not showing properly so you can see all divisions what should be hidden in the page like you must enable JavaScript in your browser.
i had simmilar problems with GeckoFx my suggestion is moving to WEBKITDOTNET is the best for now as compenent
Here
Is there any way to take a screenshot with ASP.net C#, or can we take screenshot of any URL?
Asp.net runs on the web server so there is not way to take a screen shot of the client.
you should use java script and perhaps an ActiveX control to achieve that.
I would not recommend you to go down this road anyway
what you can it to store the content of the page (if this can help) doing something like the below
WebClient client = new WebClient();
string downloadString = client.DownloadString("http://www.gooogle.com");
You can then create and .html file which will look like that page
I have a div and inside it exists one gridview and few other divs. Now I want to convert its contents to an image and store it on the server. I don't want to send it to client.
How can I do it?
The Page Content will be process in browser and browser is in client side
so you dont now how it seems in server side ,in server side we just have html and scripts ...
so the link ddrace gave may be usefull, or you can develope a windows App and put a webbrowser on it and load your page in the browser and save the image of browser to the server
You're going to have to use a piece of middleware to do this. I have used this one in the past: http://www.winnovative-software.com/Html-To-Pdf-Converter.aspx . I know it says "to PDF", but one of it's features is that it can render the result to an image and save it in various image formats.
In your web application, have the middleware components bring the web-page down that has your control etc on it, and save it as an image on the server.