บทความนี้สาธิตวิธีการตรวจสอบว่า StringCollection เป็น read-only หรือไม่ โดยใช้ property IsReadOnly พร้อมกับการตรวจสอบค่าด้วย Contains ตัวอย่างที่ 1: ตรวจสอบ IsReadOnly และ Contains using System; using System.Collections.Specialized; public class Demo { public static void Main() { S