本文整理汇总了C#中WebView.LoadURL方法的典型用法代码示例。如果您正苦于以下问题:C# WebView.LoadURL方法的具体用法?C# WebView.LoadURL怎么用?C# WebView.LoadURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView.LoadURL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TitleScreen
public TitleScreen(DangerZone pParent)
: base(pParent)
{
#if WINDOWS
WebCoreConfig pConfig = new WebCoreConfig();
pConfig.EnableJavascript = true;
//WebCore.Initialize(pConfig, true);
this.Parent.IsMouseVisible = true;
m_pWebView = WebCore.CreateWebView(800, 600);
{
m_pWebView.LoadURL("http://www.google.com"); //Content\\Editor\\index.html
while (m_pWebView.IsLoadingPage)
WebCore.Update();
m_pWebView.Render().SaveToPNG("result.png", true);
/*
* Här kan vi då kanske ladda in filen?
*/
}
//WebCore.Shutdown();
#endif
}
示例2: Browser
public Browser(Guid id, string url, int width, int height)
{
Id = id;
_width = width;
_height = height;
webView = WebCore.CreateWebView(width, height);
webView.ResizeComplete += webView_ResizeComplete;
webView.IsDirtyChanged += webView_IsDirtyChanged;
//webView.SelectLocalFiles += webView_SelectLocalFiles;
webView.CursorChanged += webView_CursorChanged;
webView.LoadCompleted += new EventHandler(webView_LoadCompleted);
webView.LoadURL(url);
webView.Focus();
}
示例3: Start
public void Start()
{
Debug.Log( "Initializing WebCore." );
// WebCoreInitializer.Awake() initializes the WebCore
// before any Start() function on any script is called.
// We create a web-view here.
webView = WebCore.CreateWebView( width, height );
// Load the defined URL.
webView.LoadURL( initialURL );
// Prepare and a assign a texture to the component.
// The texture will display the pixel buffer of the WebView.
texture = new Texture2D( width, height, TextureFormat.RGBA32, false );
Pixels = texture.GetPixels32( 0 );
PixelsHandle = GCHandle.Alloc( Pixels, GCHandleType.Pinned );
if ( renderer )
renderer.material.mainTexture = texture;
else if ( GetComponent( typeof( GUITexture ) ) )
{
GUITexture gui = GetComponent( typeof( GUITexture ) ) as GUITexture;
gui.texture = texture;
}
else
Debug.LogError( "Game Object has no Material or GUI Texture, we cannot render a web-page to this object!" );
mainScript = GameObject.Find("Main").GetComponent<MainMenu>();
// Handle some important events.
webView.OpenExternalLink += OnWebViewOpenExternalLink;
webView.ShowJavascriptDialog += OnJavascriptDialog;
webView.LoginRequest += OnLoginRequest;
}