小编Min*_*bob的帖子

Java Scanner Class坏字符"®"

我有一个扫描仪类将文件读入字符串.具有此字符"®"的任何文件都会导致其失败.我是Java的新手,是否有更好的方法来读取此文件以便接受该字符?

public void readFile(String fileName)
{
    fileText = "";

    try
    {
        Scanner file = new Scanner(new File(fileName));
        while (file.hasNextLine())
        {
            String line = file.nextLine();
            fileText += line +"\r"+"\n";
        }
        file.close();
    }
    catch (Exception e)
    {
         System.out.println(e);

   }
      }
Run Code Online (Sandbox Code Playgroud)

java unicode

25
推荐指数
2
解决办法
1503
查看次数

powershell 中的 System.Windows.Forms.ListView 隐藏输出

用下面的代码

$listView = New-Object System.Windows.Forms.ListView
$listView.View = 'Details'
$listView.Width = 300
$listView.Height = 300
$listView.Columns.Add('User Name')
Run Code Online (Sandbox Code Playgroud)

DisplayIndex:0 索引:0 ImageIndex:-1 ImageList:ImageKey:ListView:System.Windows.Forms.ListView,Items.Count:0 名称:文本:用户名 TextAlign:左标签:宽度:60 站点:容器:

它在 powershell 控制台中输出以上内容。我怎样才能隐藏这个输出。

它干扰我在 -noconsole 模式下使用此脚本进行转换https://gallery.technet.microsoft.com/scriptcenter/PS2EXE-GUI-Convert-e7cb69d5

powershell listview winforms

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

标签 统计

java ×1

listview ×1

powershell ×1

unicode ×1

winforms ×1