我有一个扫描仪类将文件读入字符串.具有此字符"®"的任何文件都会导致其失败.我是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) 用下面的代码
$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