【问题标题】:Create WPF application that plays a browser game [closed]创建播放浏览器游戏的 WPF 应用程序 [关闭]
【发布时间】:2017-07-26 12:56:22
【问题描述】:

嗨 :) 我想创建一个可以自己玩浏览器游戏的 WPF 应用程序 (https://slowotok.pl/)。我该怎么办?我对所有 .NET 东西都很陌生。

【问题讨论】:

    标签: .net wpf webbrowser-control


    【解决方案1】:

    您可以为此使用WebBrowser 控件。

    <Window x:Class="WpfApp1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:local="clr-namespace:WpfApp1"
            mc:Ignorable="d"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <WebBrowser Source="https://slowotok.pl/" />
        </Grid>
    </Window>
    

    查看MSDN 了解更多信息。

    【讨论】:

    • 这允许我在应用程序中显示一个游戏 - 但它是否允许我创建一个实际运行游戏的代码?
    • @Jecke 您可以查看该嵌入式浏览器的 DOM 并进行点击等您需要的操作。
    【解决方案2】:

    您不需要使用 WPF 来执行此操作。试试 Selenium http://www.seleniumhq.org/ 或创建浏览器扩展。

    【讨论】:

    • 我可能不需要;但不幸的是我必须这样做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-18
    • 2014-08-13
    相关资源
    最近更新 更多