41 lines
818 B
Plaintext
41 lines
818 B
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
----
|
|
using System;
|
|
public class C
|
|
{
|
|
public void Main()
|
|
{
|
|
Console.In; // Sensitive
|
|
var code = Console.Read(); // Sensitive
|
|
var keyInfo = Console.ReadKey(...); // Sensitive
|
|
var text = Console.ReadLine(); // Sensitive
|
|
Console.OpenStandardInput(...); // Sensitive
|
|
}
|
|
}
|
|
----
|
|
|
|
== Exceptions
|
|
|
|
This rule does not raise issues when the return value of the `+Console.Read+` `+Console.ReadKey+` or `+Console.ReadLine+` methods is ignored.
|
|
|
|
----
|
|
using System;
|
|
public class C
|
|
{
|
|
public void Main()
|
|
{
|
|
Console.ReadKey(...); // Return value is ignored
|
|
Console.ReadLine(); // Return value is ignored
|
|
}
|
|
}
|
|
----
|
|
|
|
include::../see.adoc[]
|