开发者

What is the use of #pragma warning in C#?

开发者 https://www.devze.com 2023-01-07 11:17 出处:网络
I just saw this code #pragma warning disable 659, 660, 661 MSDN article is not helping m开发者_开发知识库uch. What is the usage of this line?From your link:

I just saw this code

#pragma warning disable 659, 660, 661

MSDN article is not helping m开发者_开发知识库uch. What is the usage of this line?


From your link:

#pragma warning may be used to enable or disable certain warnings.

If you know some code will throw a warning but you want to ignore it, you can then use this. This will prevent the message from being shown.


In C# errors and warnings have numbers. #pragma warning disable allows you to suppress some warnings that the compiler might emit.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号