Advertisement
DrAungWinHtut

Read Q and Split

Mar 2nd, 2022
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.IO;
  11.  
  12. namespace _2022030201_CS_Array_Tutorial
  13. {
  14.     public partial class frmArray : Form
  15.     {
  16.         public frmArray()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void btnTest_Click(object sender, EventArgs e)
  22.         {
  23.             // File ကနေ တစ်ကြောင်းချင်းဖတ်ရန်
  24.             string line = "";
  25.             string[] saPQ = new string[6];
  26.             StreamReader sr = new StreamReader("questions.txt");
  27.             // တစ်လိုင်းချင်းဖတ်မှာ
  28.             while ((line = sr.ReadLine()) != null)
  29.             {
  30.                 // တစ်ကြောင်းချင်းကနေ အပိုင်း၆ပိုင်း ခွဲထုတ်ရန်              
  31.                 saPQ = line.Split('$');
  32.                 // အပိုင်း ၆ ပိုင်းကို 5 ပိုင်းကို UI ပေါ်တင်ရမယ်။ User အဖြေကို နောက်ဆုံး အပိုင်း အဖြေမှန်နဲ့ တိုက်ဆိုင်စစ်ဆေးမယ်
  33.             }
  34.             sr.Close();
  35.  
  36.            
  37.            
  38.            
  39.         }
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement