C#中的Console.MoveBufferArea()方法用於將屏幕緩衝區的指定源區域複製到指定的目標區域。
用法
語法如下 -
public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);
這裏,
- sourceLeft
源區最左邊的一列。
- sourceTop
源區域的最上麵一行。
- sourceWidth
源區域中的列數。
- sourceHeight
源區域中的行數。
- targetLeft
目標區域最左邊的一列。
- targetTop
目標區域的最上麵一行。
示例
現在讓我們看一個在 C# 中實現 Console.MoveBufferArea() 方法的例子 -
using System;
class Demo {
public static void Main (string[] args) {
Console.WriteLine("Demo text!");
Console.MoveBufferArea(0, 0, Console.BufferWidth, Console.BufferHeight, 20, 20);
}
}
輸出
這將產生以下輸出 -
相關用法
- C# Console.MoveBufferArea用法及代碼示例
- C# Console.Clear用法及代碼示例
- C# Console.SetOut()用法及代碼示例
- C# Console.SetIn()用法及代碼示例
- C# Console.SetWindowPosition()用法及代碼示例
- C# Console.SetBufferSize()用法及代碼示例
- C# Console.TreatControlCAsInput用法及代碼示例
- C# Console.SetWindowSize()用法及代碼示例
- C# Console.ReadKey()用法及代碼示例
- C# Console.SetCursorPosition()用法及代碼示例
- C# Console.ReadLine()用法及代碼示例
- C# Console.OpenStandardInput用法及代碼示例
- C# Console.OpenStandardError用法及代碼示例
- C# Console.Read()用法及代碼示例
- C# Console.SetError()用法及代碼示例
- C# Console.ResetColor()用法及代碼示例
- C# Console.OpenStandardOutput()用法及代碼示例
- C# Convert.ToInt16(String, IFormatProvider)用法及代碼示例
- C# Convert.ToChar(String, IFormatProvider)用法及代碼示例
- C# Convert.ToUInt64(String, IFormatProvider)用法及代碼示例
注:本文由純淨天空篩選整理自AmitDiwan大神的英文原創作品 Console.MoveBufferArea() Method in C#。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。