小编Moj*_*kht的帖子

类型名称“Create”在类型 XmlWriter 中不存在

我正在尝试在 Visual Studio 2017 上编写 Xml 程序,但出现错误:

using System.Xml;
...
XmlWriter.Create("C:\\myxmlfile.xml", settings);
Run Code Online (Sandbox Code Playgroud)

有了这个消息:The type name 'Create' doesn't exist in the type XmlWriter.

我怀疑我的 Visual Studio 的不完整安装(不幸的是尚未修复)导致了此问题。我该如何修复它?

xml xmlwriter visual-studio-2017

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

为什么这段代码总是返回文件大小为零?

为什么,当我使用下面的代码片段的结果是零,无论文件大小,但是当我删除ios::binaryopen()它做什么,它应该做的?

fstream f1;    
streampos begin, end;
f1.open("file1", ios::binary);
f1.seekg(0, ios::beg);
begin = f1.tellg();
f1.seekg(0, ios::end);
end = f1.tellg();
f1.close();
cout << end - begin << endl;
Run Code Online (Sandbox Code Playgroud)

c++ binary fstream file operation

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

标签 统计

binary ×1

c++ ×1

file ×1

fstream ×1

operation ×1

visual-studio-2017 ×1

xml ×1

xmlwriter ×1