Export (0) Print
Expand All

Console.Write Method (UInt64)

Writes the text representation of the specified 64-bit unsigned integer value to the standard output stream.

This method is not CLS-compliant.  

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

[CLSCompliantAttribute(false)] 
public:
static void Write (
	usigned long long value
)
/** @attribute CLSCompliantAttribute(false) */ 
public static void Write (
	UInt64 value
)
CLSCompliantAttribute(false) 
public static function Write (
	value : ulong
)

Parameters

value

The value to write.

Exception typeCondition

IOException

An I/O error occurred.

The text representation of value is produced by calling the UInt64.ToString method.

The following code example illustrates the use of the Write method.

int main()
{
   array<String^>^lineInputArr = {"1   2.2   hello	TRUE","2   5.22   bye	FALSE","3   6.38   see ya'	TRUE"};
   for ( Int32 i = 0; i < 3; i++ )
   {
      String^ lineInput = lineInputArr->GetValue( i )->ToString();
      String^ aChar =  "\t";
      array<String^>^fields = lineInput->Split( aChar->ToCharArray() );
      Boolean isFirstField = true;
      for ( Int32 i = 0; i < fields->Length; i++ )
      {
         if ( isFirstField )
                  isFirstField = false;
         else
                  Console::Write( "," );
         
         // If the field represents a boolean, replace with a numeric representation.
         try
         {
            Console::Write( Convert::ToByte( Convert::ToBoolean( fields[ i ] ) ) );
         }
         catch ( FormatException^ ) 
         {
            Console::Write( fields[ i ] );
         }


      }
      Console::WriteLine();

   }
}


public class FormatConverter
{
    public static void main(String[] args)
    {
        String lineInput;

        while (((lineInput = Console.ReadLine()) != null)) {
            String fields[] = lineInput.Split(new char[] { '\t' });
            boolean isFirstField = true;
            String item = null;
            for (int iCtr = 0; iCtr < fields.length; iCtr++) {
                item = fields[iCtr];
                if (isFirstField) {                
                    isFirstField = false;
                }
                else {                
                    Console.Write(',');
                } 
                // If the field represents a boolean, replace with a numeric 
                // representation.
                try {                
                    Console.Write(Convert.ToByte(Convert.ToBoolean(item)));
                }
                catch (FormatException exp) {                
                    Console.Write(item);
                }
            }
            Console.WriteLine();
        }
    } //main
} //FormatConverter

var lineInput : String;
while ((lineInput = Console.ReadLine()) != null) {
    var fields : String[] = lineInput.Split(char[](['\t']));
    var isFirstField : Boolean = true;
    for(var i in fields) {
        var item = fields[i];
        if (isFirstField)
            isFirstField = false;
        else
            Console.Write(',');
        // If the field represents a boolean, replace with a numeric representation.
        try {
            Console.Write(Convert.ToByte(Convert.ToBoolean(item)));
        }
        catch(FormatException) {
            Console.Write(item);
        }
    }
    Console.WriteLine();
}

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft