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

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

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

    เมธอด MathF.IEEERemainder() ใน C# ใช้สำหรับส่งคืนเศษที่ได้จากการหารตัวเลขหนึ่งด้วยอีกตัวหนึ่ง ตามมาตรฐาน IEEE 754ไวยากรณ์public static float IEEERemainder (float dividend, double divisor);ตัวอย่างusing System; public class Demo { public static void Main(){ float val1 = 90.5f;

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

    เมธอด MathF.Log() ใน C# ใช้สำหรับส่งคืนลอการิทึมธรรมชาติ (ฐาน e) ของตัวเลขที่ระบุไวยากรณ์public static float Log (float val);พารามิเตอร์ val คือตัวเลขที่ต้องการคำนวณลอการิทึมธรรมชาติตัวอย่างusing System; public class Demo { public static void Main(){ float val1 = 0.0f; float

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

    เมธอด MathF.Log10() ใน C# ใช้สำหรับส่งคืนลอการิทึมฐาน 10 ของตัวเลขที่ระบุไวยากรณ์public static float Log10 (float val);พารามิเตอร์ val คือตัวเลขที่ต้องการคำนวณลอการิทึมตัวอย่างusing System; public class Demo { public static void Main(){ float val1 = 45.9f; float val2 = -4.35f

  5. วิธีเปลี่ยนการมองเห็นของ Cursor ใน Console C#

    หากต้องการเปลี่ยนการมองเห็นของเคอร์เซอร์ ให้ใช้คุณสมบัติ Console.CursorVisibleตัวอย่าง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.BackgroundColor

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

    ใช้คุณสมบัติ Console.WindowHeight เพื่อเปลี่ยนความสูงของหน้าต่าง Consoleตัวอย่าง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.InputEncoding = Encod

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

    ใช้คุณสมบัติ Console.WindowLeft เพื่อเปลี่ยนตำแหน่งแนวนอนของหน้าต่าง Console ใน 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.InputEncodi

  8. เมธอด UInt32.CompareTo() ใน C# พร้อมตัวอย่าง

    เมธอด UInt32.CompareTo() ใน C# ใช้เปรียบเทียบอินสแตนซ์ปัจจุบันกับออบเจ็กต์หรือ UInt32 ที่ระบุ และส่งคืนค่าที่บ่งชี้ความสัมพันธ์เชิงสัมพัทธ์ของค่าทั้งสองไวยากรณ์public int CompareTo (object val); public int CompareTo (uint val);พารามิเตอร์ val สำหรับไวยากรณ์แรกคือออบเจ็กต์ที่ต้องการเปรียบเทียบ ส่วนไ

  9. เมธอด UInt32.Equals() ใน C# พร้อมตัวอย่าง

    เมธอด UInt32.Equals() ใน C# ส่งคืนค่าที่บ่งชี้ว่าอินสแตนซ์นี้เท่ากับออบเจ็กต์ที่ระบุหรือ UInt32 อื่นหรือไม่ไวยากรณ์public override bool Equals (object ob); public bool Equals (uint ob);พารามิเตอร์ ob สำหรับไวยากรณ์แรกคือออบเจ็กต์ที่ต้องการเปรียบเทียบ ส่วนไวยากรณ์ที่สองคือจำนวนเต็ม 32 บิตไม่มีเครื่อ

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

    ใช้คุณสมบัติ Console.WindowTop เพื่อเปลี่ยนตำแหน่งแนวตั้งของหน้าต่าง Console ใน 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.InputEncodi

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

    ใช้คุณสมบัติ Console.WindowWidth เพื่อเปลี่ยนความกว้างของหน้าต่าง Consoleตัวอย่าง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.InputEncoding = Enco

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

    เมธอด UInt32.GetHashCode() ใน C# ใช้สำหรับรับรหัสแฮช (HashCode) สำหรับอินสแตนซ์ UInt32 ปัจจุบันไวยากรณ์public override int GetHashCode ();ตัวอย่างusing System; public class Demo { public static void Main(){ uint val1 = 100; uint val2 = UInt16.MinValue; Console.WriteL

  13. เมธอด Uri.HexEscape(Char) ใน C#

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

  14. เมธอด ToUpper() ใน C#

    เมธอด ToUpper() ใน C# ใช้สำหรับส่งคืนสำเนาของสตริงที่แปลงเป็นตัวพิมพ์ใหญ่ทั้งหมดแล้วไวยากรณ์public string ToUpper ();ตัวอย่างusing System; public class Demo { public static void Main(String[] args) { string str1 = Welcome!; string str2 = Thisisit!; char[] arr1 = str1

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

    เมธอด Trim() ใน C# ใช้สำหรับคืนค่า String ใหม่ที่ลบ Leading และ Trailing Characters ที่ระบุออกจาก String ปัจจุบัน Syntax public string Trim (); public string Trim (params char[] trimChars); trimChars คือ Array ของ Unicode Characters ที่ต้องการลบ หรือ null ตัวอย่าง using System; using System.Globa

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

    เมธอด Equals() ใน C# ใช้สำหรับตรวจสอบว่า String Object สองตัวมีค่าเท่ากันหรือไม่ Syntax bool string.Equals(string s1, string s2) s1 และ s2 คือ String ที่จะเปรียบเทียบ ตัวอย่าง using System; public class Demo { public static void Main(string[] args) { string s1 = Kevin; strin

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

    เมธอด BitConverter.ToChar() ใน C# ใช้สำหรับคืนค่า Unicode Character ที่แปลงจาก 2 ไบต์ ณ ตำแหน่งที่ระบุใน Byte Array Syntax public static char ToChar (byte[] value, int begnIndex); value คือ Byte Array, begnIndex คือตำแหน่งเริ่มต้นใน value ตัวอย่าง using System; public class Demo { public stat

  18. เมธอด Single.Equals() ใน C# พร้อมตัวอย่าง

    เมธอด Single.Equals() ใน C# ใช้สำหรับคืนค่าบอกว่า Instance ของ Single ทั้งสองมีค่าเท่ากันหรือไม่ Syntax public bool Equals (float ob); public override bool Equals (object ob); พารามิเตอร์ ob สำหรับทั้ง 2 Syntax คือ Object ที่จะเปรียบเทียบกับ Instance นี้ ตัวอย่าง using System; public class Demo {

  19. เมธอด BitConverter.ToString(Byte[]) ใน C# พร้อมตัวอย่าง

    เมธอด BitConverter.ToString() ใน C# ใช้สำหรับแปลงค่าตัวเลขของแต่ละ Element ใน Byte Array ให้เป็น Hexadecimal String Representation Syntax public static string ToString (byte[] val); val คือ Byte Array ตัวอย่าง using System; public class Demo { public static void Main() { byte[] arr =

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