我收到一條錯誤訊息,說底部不能大于或等于頂部。
我正在使用Rectangle此處記錄的建構式:https : //docs.microsoft.com/en-us/dotnet/api/system.management.automation.host.rectangle.-ctor? view = powershellsdk- 1.1.0# System_Management_Automation_Host_Rectangle__ctor_System_Int32_System_Int32_System_Int32_System_Int
這是我的相關代碼部分;
Console.WriteLine("setting rectangles: " sizex ", " sizey);
int screenTop = sizey;
int screenBottom = 1;
int statusTop = 1;
int statusBottom = 0;
Console.WriteLine ("screen top bottom; " screenTop " > " screenBottom );
Console.WriteLine ("status top bottom; " statusTop " > " statusBottom );
// Rectangle(int left, int top, int right, int bottom);
System.Management.Automation.Host.Rectangle screenWindowRect = new Rectangle(0,screenTop,sizex,screenBottom);
System.Management.Automation.Host.Rectangle statusLineRect = new Rectangle(0,statusTop,sizex,statusBottom);
Console.WriteLine("rectangles set");
我在建構式之前看到除錯行,但從未看到“矩形設定”訊息。
這是輸出;
setting rectangles: 241, 28
screen top bottom; 28 > 1
status top bottom; 1 > 0
Out-Less: "bottom" cannot be greater than or equal to "top".
我可以看到頂部大于底部,但我不斷收到錯誤訊息; "bottom" cannot be greater than or equal to "top"
這是錯誤還是檔案錯誤,還是我遺漏了什么。
uj5u.com熱心網友回復:
錯誤訊息錯誤地陳述了實際的錯誤情況:
"bottom" cannot be greater than or equal to "top"
應該:
"bottom" cannot be less than "top"
換句話說:所述bottom引數必須是大于等于或大于該top引數-而且,類似地,right必須等于或大于 left:
您可以在 PowerShell 本身中驗證這一點:
# OK: 1 -ge 1
# Arguments are: left, top, right, bottom
[System.Management.Automation.Host.Rectangle]::new(0, 1, 0, 1)
# OK: 2 -ge 1
[System.Management.Automation.Host.Rectangle]::new(0, 1, 0, 2)
# !! EXCEPTION: 0 -ge 1 is NOT true.
[System.Management.Automation.Host.Rectangle]::new(0, 1, 0, 0)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/358627.html
下一篇:在型別值上創建XPath過濾?
