使用 问答列表

错误“找不到类型或命名空间名称'Android'...”在 Visual Studio 2022 中

作者:Ola Ström 提问时间:11/29/2021

我在 Windows 10 专业版的 Visual Studio Community 2022(64 位)中收到此错误: CS0246 - 找不到类型或命名空间名称“Android”(是否缺少 us...

using 语句对变量进行多次赋值

作者:Ajinkya Jagtap 提问时间:1/31/2022

我有一个System.Drawing.Pen类型的变量“pen”,它在特定方法中被多次分配。我想把它放在“使用”语句中。我该怎么做? Pen pen = new Pen(Color.Gray); /...

如何为具有子产品/模块的产品命名空间?

作者:RagIJ 提问时间:3/6/2022

我仔细阅读了。是的,非常有帮助! https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/names-of-names...

使用父类方法作为派生类方法时出现 GCC 错误

作者:Toboxos 提问时间:5/4/2022

我的代码中有一个函数,它只接受类成员方法作为模板参数。我需要使用从父类继承的类方法来调用此方法。这是我的问题的示例代码: template <class C> class Test { public...

拥有具有私有类型的公共成员有什么意义吗?

作者:saxbophone 提问时间:6/6/2022

请考虑以下 C++ 代码,其中 member 具有私有类型:foo class Object { private: struct MyPrivateThing { long double Mem...

导入未知指令 dbquery、sdl

作者:Bulatron 提问时间:9/14/2022

我正在使用 Stepzen,它生成了 graphql 文件,但是,所有这些文件都有错误: stepzen/index.graphql schema @sdl(files: ["postgresql...

使用 using alias 指令对泛型接口进行别名化

作者:Ernest3.14 提问时间:12/2/2022

我知道不可能为泛型类型设置别名(例如 无效),但必须关闭右侧的泛型类型(例如 将起作用)。using Foo = Dictionary;using Foo = Dictionary<int, stri...

为什么我们在 C# 中使用嵌套的 using 语句?

作者:Prakash sekar 提问时间:12/12/2022

using (StreamReader outFile = new StreamReader(outputFile.OpenRead())) { StreamReader resFile = n...

何时处置“using var”?是尽快超出范围还是在块结束时?

作者:geekley 提问时间:1/5/2023

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using#using-...

在成员函数中为继承的成员字段使用声明

作者:francesco 提问时间:1/8/2023

在函数内部,可以使用 using 声明在当前作用域中导入名称,例如 namespace A { int y; } void f() { using A::y; } using 声明可以在类定...


共107条 当前第7页