WebView控制地铁风格应用程序

WebView控制地铁风格应用程序,webview,microsoft-metro,Webview,Microsoft Metro,如何在metro style应用程序的webview控件的源属性中使用URL发送参数。您只需将它们添加到URL即可 source="http://myurl/?param1=hello&param2=world" 或者也可以插入javascript文件与网页通信: Uri uri = new Uri("ms-appx:///js/script.js"); StorageFile file = await StorageFile.GetFileFromApplicationUriAsy

如何在metro style应用程序的webview控件的源属性中使用URL发送参数。

您只需将它们添加到URL即可

 source="http://myurl/?param1=hello&param2=world"

或者也可以插入javascript文件与网页通信:

Uri uri = new Uri("ms-appx:///js/script.js");
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
string text = await FileIO.ReadTextAsync(file); //reading content as string
var script = "(function(){" + text + "})()";

欢迎来到堆栈溢出!我们鼓励你这样做。如果您有,请将其添加到问题中-如果没有,请先研究并尝试您的问题,然后再回来。