Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> C#
C#
  1. โครงสร้าง Decimal ใน C#

    โครงสร้าง Decimal ใน C# แทนจำนวนจุดทศนิยมแบบทศนิยม ค่าประเภท Decimal แทนตัวเลขตั้งแต่บวก 79,228,162,514,264,337,593,543,950,335 ถึงลบ 79,228,162,514,264,337,593,543,950,335 ค่าเริ่มต้นของ Decimal คือ 0มา看看ตัวอย่างเมธอดต่างๆ ในโครงสร้าง DecimalDecimal.Add()เมธอด Decimal.Add() ใน C# ใช้สำหรับบวกค่า De

  2. คลาส Console ใน C#

    คลาส Console ใน C# ใช้แทนสตรีมอินพุต เอาต์พุต และข้อผิดพลาดมาตรฐานสำหรับแอปพลิเคชันคอนโซลมา看看ตัวอย่างคุณสมบัติต่างๆ ของคลาส Console ใน C#คุณสมบัติ Console.CursorLeftใช้คุณสมบัติ Console.CursorLeft เพื่อเปลี่ยนตำแหน่งแนวนอนของเคอร์เซอร์ใน C#ตัวอย่างusing System; class Demo { public static void

  3. คุณสมบัติ Console.KeyAvailable ใน C#

    คุณสมบัติ Console.KeyAvailable ใน C# ใช้สำหรับตรวจสอบว่ามีการกดปุ่มพร้อมใช้งานในสตรีมอินพุตหรือไม่ไวยากรณ์public static bool KeyAvailable { get; }ตัวอย่างusing System; using System.Threading; class Demo { public static void Main (string[] args) { ConsoleKeyInfo cs = new ConsoleKeyIn

  4. เมธอด Console.MoveBufferArea() ใน C#

    เมธอด Console.MoveBufferArea() ใน C# ใช้สำหรับคัดลอกพื้นที่ต้นทางของบัฟเฟอร์หน้าจอไปยังพื้นที่ปลายทางที่ระบุไวยากรณ์public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);พารามิเตอร์:sourceLeft - คอลัมน์ซ้ายสุดของพื้นที่ต้น

  5. เมธอด Console.Read() ใน C#

    เมธอด Console.Read() ใน C# ใช้สำหรับอ่านอักขระถัดไปจากสตรีมอินพุตมาตรฐาน และส่งคืนค่าเป็นรหัส ASCII (int)ไวยากรณ์public static int Read ();ตัวอย่างusing System; public class Demo{ public static void Main(){ int val; Console.WriteLine(Enter a value); val = Console.Rea

  6. เมธอด Console.ReadLine() ใน C#

    เมธอด Console.ReadLine() ใน C# ใช้สำหรับอ่านบรรทัดถัดไปของอักขระจากสตรีมอินพุตมาตรฐานไวยากรณ์public static string ReadLine ();ตัวอย่างusing System; public class Demo{ public static void Main(){ string str; Console.WriteLine(Enter any subject...); str = Console.ReadLi

  7. เมธอด Console.ResetColor() ใน C#

    เมธอด Console.ResetColor() ใน C# ใช้สำหรับตั้งค่าสีพื้นหลังและสีพื้นหน้าของคอนโซลกลับเป็นค่าเริ่มต้นไวยากรณ์public static void ResetColor ();ตัวอย่างusing System; class Demo { public static void Main (string[] args) { Console.WriteLine (At first, we have set colors here...\nAfter that

  8. เมธอด Console.SetBufferSize() ใน C#

    เมธอด Console.SetBufferSize() ใน C# ใช้สำหรับตั้งค่าความสูงและความกว้างของพื้นที่บัฟเฟอร์หน้าจอเป็นค่าที่ระบุไวยากรณ์public static void SetBufferSize (int width, int height);พารามิเตอร์ width คือความกว้างของพื้นที่บัฟเฟอร์ ส่วน height คือความสูงของพื้นที่บัฟเฟอร์ตัวอย่างusing System; class Demo {

  9. เมธอด Uri.IsHexDigit() ใน C#

    เมธอด Uri.IsHexDigit() ใน C# ใช้ตรวจสอบว่าอักขระที่ระบุเป็นตัวเลขฐานสิบหกที่ถูกต้องหรือไม่ไวยากรณ์public static bool IsHexDigit (char ch);พารามิเตอร์ ch คืออักขระที่ต้องการตรวจสอบตัวอย่างusing System; public class Demo { public static void Main(){ char ch = e; Console.WriteLi

  10. เมธอด MathF.Cos() ใน C# พร้อมตัวอย่าง

    เมธอด MathF.Cos() ใน C# ส่งคืนโคไซน์ของค่า float ที่ระบุ (เป็นเรเดียน)ไวยากรณ์public static float Cos (float val);พารามิเตอร์ val คือมุมในหน่วยเรเดียนตัวอย่างusing System; class Demo { public static void Main(){ float val1 = 70f; float res = (val1 * (MathF.PI)) / 180;

  11. เมธอด MathF.Cosh() ใน C# พร้อมตัวอย่าง

    เมธอด MathF.Cosh() ใน C# ใช้สำหรับส่งคืนโคไซน์ไฮเปอร์โบลิกของค่าจุดทศนิยมไวยากรณ์public static float Cosh (float val);พารามิเตอร์ val คือจำนวนจุดทศนิยมตัวอย่างusing System; class Demo { public static void Main(){ float val = 45.0f; float res = MathF.Cosh(val); Consol

  12. เมธอด MathF.Exp() ใน C# พร้อมตัวอย่าง

    เมธอด MathF.Exp() ใน C# ส่งคืนค่า e ยกกำลังของตัวเลขที่ระบุ (e^x)ไวยากรณ์public static float Exp (float val);พารามิเตอร์ val คือจำนวนจุดทศนิยมที่เป็นเลขชี้กำลังตัวอย่างusing System; class Demo { public static void Main(){ float val = 90f; float res = MathF.Exp(val);

  13. วิธีเปลี่ยนสีพื้นหลังข้อความใน C# Console

    หากต้องการเปลี่ยนสีพื้นหลังของข้อความในคอนโซล ให้ใช้คุณสมบัติ Console.BackgroundColor ใน C#ตัวอย่างusing System; class Demo { public static void Main (string[] args) { Console.BackgroundColor = ConsoleColor.Blue; Console.WriteLine(Background color changed = + Console.Backgro

  14. วิธีเปลี่ยน BufferHeight ของ Console ใน C#

    หากต้องการเปลี่ยนความสูงของบัฟเฟอร์คอนโซล ให้ใช้คุณสมบัติ Console.BufferHeight ใน C#ตัวอย่างusing System; class Demo { public static void Main (string[] args) { Console.BufferHeight = 200; Console.WriteLine(Buffer Height = + Console.BufferHeight); } }ผลลัพธ์Buffer Heig

  15. วิธีเปลี่ยน CursorTop ของ Console ใน C#

    หากต้องการเปลี่ยนตำแหน่งแนวตั้งของเคอร์เซอร์ใน C# ให้ใช้คุณสมบัติ Console.CursorTopตัวอย่างusing System; class Demo { public static void Main (string[] args) { Console.BackgroundColor = ConsoleColor.Blue; Console.WriteLine(Background color changed = + Console.BackgroundColor

  16. เมธอด MathF.Max() ใน C# พร้อมตัวอย่าง

    เมธอด MathF.Max() ใน C# ส่งคืนค่าที่มากที่สุดจากสองตัวเลขที่ระบุไวยากรณ์public static float Max (float val1, float val2);พารามิเตอร์ val1 คือตัวเลขแรก และ val2 คือตัวเลขที่สอง ทั้งสองจะถูกเปรียบเทียบกันตัวอย่างusing System; public class Demo { public static void Main(){ float val1 = 1

  17. เมธอด MathF.Min() ใน C# พร้อมตัวอย่าง

    เมธอด MathF.Min() ใน C# ส่งคืนค่าที่น้อยที่สุดจากสองตัวเลขที่ระบุไวยากรณ์public static float Min (float val1, float val2);พารามิเตอร์ val1 คือตัวเลขแรก และ val2 คือตัวเลขที่สอง ทั้งสองจะถูกเปรียบเทียบกันตัวอย่างusing System; public class Demo { public static void Main(){ float val1 =

  18. วิธีเปลี่ยน Input Encoding Scheme ของ C# Console

    หากต้องการเปลี่ยนรูปแบบการเข้ารหัสอินพุตของคอนโซล ให้ใช้คุณสมบัติ Console.InputEncodingตัวอย่างusing System; using System.Collections.Generic; using System.Threading.Tasks; using System.Linq; using System.Text; class Demo { public static void Main (string[] args) { Console.Backgr

  19. วิธีเปลี่ยน Output Encoding Scheme ของ C# Console

    ใช้คุณสมบัติ Console.OutputEncoding ใน C# เพื่อเปลี่ยนรูปแบบการเข้ารหัสเอาต์พุตของคอนโซลตัวอย่างusing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Demo { public static void Main (string[] args) { Console.Backg

Total 2668 -คอมพิวเตอร์  FirstPage PreviousPage NextPage LastPage CurrentPage:93/134  20-คอมพิวเตอร์/Page Goto:1 87 88 89 90 91 92 93 94 95 96 97 98 99