Console.Title プロパティとは? わかりやすく解説

Console.Title プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

コンソールタイトル バー表示するタイトル取得または設定します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

例外例外
例外種類条件

InvalidOperationException

取得操作取得されタイトルが 24500 文字超えてます。

ArgumentOutOfRangeException

設定操作指定されタイトルが 24500 文字超えてます。

ArgumentNullException

設定操作指定されタイトルnull 参照 (Visual Basic では Nothing) です。

IOException

I/O エラー発生しました

解説解説

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition プラットフォームメモ : タイトル文字列最大長は ANSI 文字 127 個分です。Unicode 文字サポートされません。

使用例使用例

Title プロパティ使用例次に示します。この例では、オペレーティング システム ウィンドウ現在のタイトル表示してキー押されるのを待機した後、新しタイトル表示します

' This example demonstrates the Console.Title property.
Imports System
Imports Microsoft.VisualBasic

Class Sample
   Public Shared Sub Main()
      Console.WriteLine("The current console title is: ""{0}""",
 Console.Title)
      Console.WriteLine("  (Press any key to change the console
 title.)")
      Console.ReadKey(True)
      Console.Title = "The title has changed!"
      Console.WriteLine("Note that the new console title is ""{0}"""
 & vbCrLf & _
                        "  (Press any key to quit.)",
 Console.Title)
      Console.ReadKey(True)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'>myTitle
'The current console title is: "Command Prompt - myTitle"
'  (Press any key to change the console title.)
'Note that the new console title is "The title has changed!"
'  (Press any key to quit.)
'
// This example demonstrates the Console.Title property.
using System;

class Sample 
{
    public static void Main()
 
    {
    Console.WriteLine("The current console title is: \"{0}\""
,
                      Console.Title);
    Console.WriteLine("  (Press any key to change the console title.)");
    Console.ReadKey(true);
    Console.Title = "The title has changed!";
    Console.WriteLine("Note that the new console title is
 \"{0}\"\n" +
                      "  (Press any key to quit.)", Console.Title);
    Console.ReadKey(true);
    }
}
/*
This example produces the following results:

>myTitle
The current console title is: "Command Prompt - myTitle"
  (Press any key to change the console title.)
Note that the new console title is "The title has changed!"
  (Press any key to quit.)

*/
// This example demonstrates the Console.Title property.
using namespace System;
int main()
{
   Console::WriteLine( "The current console title is: \"{0}\"",
 Console::Title );
   Console::WriteLine( "  (Press any key to change the console title.)"
 );
   Console::ReadKey( true );
   Console::Title = "The title has changed!";
   Console::WriteLine( "Note that the new console title is
 \"{0}\"\n"
   "  (Press any key to quit.)", Console::Title );
   Console::ReadKey( true );
}

/*
This example produces the following results:

>myTitle
The current console title is: "Command Prompt - myTitle"
  (Press any key to change the console title.)
Note that the new console title is "The title has changed!"
  (Press any key to quit.)

*/
// This example demonstrates the Console.Title property.
import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        Console.WriteLine("The current console title is: \"{0}\""
,
            Console.get_Title());
        Console.WriteLine("  (Press any key to change the console title.)");
        Console.ReadKey(true);
        Console.set_Title("The title has changed!");
        Console.WriteLine("Note that the new console title
 is \"{0}\"\n" 
            + "  (Press any key to quit.)", Console.get_Title());
        Console.ReadKey(true);
    } //main
} //Sample
/*
This example produces the following results:

>myTitle
The current console title is: "Command Prompt - myTitle"
  (Press any key to change the console title.)
Note that the new console title is "The title has changed!"
  (Press any key to quit.)

*/
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Console.Title プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Console.Title プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS