小编Hil*_*ite的帖子

如何在visual studio中使用webView功能(C#)

如何在Visual Studio中使用C#中的webview工具创建一个Windows 8.1应用程序(一个简单的Web浏览器).我尝试过这些代码,但这两个代码都不起作用.我使用过Visual Basic但我正在尝试继续使用C#.我试过这些,但没有一个在C#中工作过,请有人帮助我.谢谢.

试过这个,但没有奏效

  private void Page_Loaded(object sender, RoutedEventArgs e)
    {
      Webview1.Navigate(http://www.bing.com);
    }
Run Code Online (Sandbox Code Playgroud)

此外,试过这个,这也没用

   private void Page_Loaded(object sender, RoutedEventArgs e)
        {
          Webview1.Navigate(New Uri(http://www.bing.com));
        }
Run Code Online (Sandbox Code Playgroud)

我做错了或者这个代码不适用于Visual Studio C#.

提前致谢.

c# webview visual-studio windows-8.1

4
推荐指数
1
解决办法
9914
查看次数

如何从文件中读取N行?

我正在尝试练习从 Java 文件中读取文本。我不太了解如何读取 N 行,比如文件中的前 10 行,然后将这些行添加到ArrayList.

例如,文件包含 1-100 个数字,如下所示;

- 1 
- 2 
- 3 
- 4 
- 5 
- 6 
- 7 
- 8 
- 9 
- 10 
- ....
Run Code Online (Sandbox Code Playgroud)

我想读取前 5 个数字,即 1,2,3,4,5 并将其添加到数组列表中。到目前为止,这是我设法做的,但我被卡住了,不知道现在该做什么。

ArrayList<Double> array = new ArrayList<Double>();
InputStream list = new BufferedInputStream(new FileInputStream("numbers.txt"));

for (double i = 0; i <= 5; ++i) {
    // I know I need to add something here so the for loop read through 
    // the file but I …
Run Code Online (Sandbox Code Playgroud)

java for-loop arraylist fileinputstream bufferedreader

3
推荐指数
1
解决办法
2万
查看次数