Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created July 26, 2013 14:47
Show Gist options
  • Save misodengaku/6089440 to your computer and use it in GitHub Desktop.
Save misodengaku/6089440 to your computer and use it in GitHub Desktop.
超手抜き艦これブラウザです
//ウィンドウサイズは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