Created
July 26, 2013 14:47
-
-
Save misodengaku/6089440 to your computer and use it in GitHub Desktop.
超手抜き艦これブラウザです
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ウィンドウサイズは840, 600ぐらいがおすすめ | |
//WebBrowser配置していい感じにイベント設定 | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace KanColle | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) | |
{ | |
if (webBrowser1.DocumentText.Contains("game_frame")) | |
{ | |
//適当なURL抜き出し | |
string html = webBrowser1.DocumentText; | |
var doc = html.Split(new string[] {"<iframe id=\"game_frame\" name=\"game_frame\" src=\""}, StringSplitOptions.RemoveEmptyEntries)[1]; | |
doc = doc.Split(new string[] { " width=\"900\" height=\"1200\"" } , StringSplitOptions.RemoveEmptyEntries)[0]; | |
webBrowser1.Navigate(doc); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment