Advertisement
Guest User

triedic

a guest
Oct 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 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 TriedickaSrobov
  13. {
  14.  
  15. public partial class Form1 : Form
  16. {
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. }
  21.  
  22. float B1;
  23. float B2;
  24. float B3;
  25. float B4;
  26. float B5;
  27. float B6;
  28. float B7;
  29. float B8;
  30. float B9;
  31. float B10;
  32. float B11;
  33. float B12;
  34. float B13;
  35. float B14;
  36. float B15;
  37. float B16;
  38. float B17;
  39. float B18;
  40. private void Form1_Load(object sender, EventArgs e)
  41. {
  42. MessageBox.Show("Vitajte v Triedicke Srobov");
  43. }
  44.  
  45. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  46. {
  47.  
  48. }
  49.  
  50. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  51. {
  52.  
  53. }
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. private void button1_Click(object sender, EventArgs e)
  70. {
  71. if (checkBox1.Checked == true)
  72. {
  73. float B1 = 1;
  74. }
  75. if (checkBox2.Checked == true)
  76. {
  77. float B2 = 1;
  78. }
  79. if (checkBox3.Checked == true)
  80. {
  81. float B3 = 1;
  82. }
  83. if (checkBox4.Checked == true)
  84. {
  85. float B4 = 1;
  86. }
  87. if (checkBox5.Checked == true)
  88. {
  89. float B5 = 1;
  90. }
  91. if (checkBox6.Checked == true)
  92. {
  93. float B6 = 1;
  94. }
  95. if (checkBox7.Checked == true)
  96. {
  97. float B7 = 1;
  98. }
  99. if (checkBox8.Checked == true)
  100. {
  101. float B8 = 1;
  102. }
  103. if (checkBox9.Checked == true)
  104. {
  105. float B9 = 1;
  106. }
  107. if (checkBox10.Checked == true)
  108. {
  109. float B10 = 1;
  110. }
  111. if (checkBox11.Checked == true)
  112. {
  113. float B11 = 1;
  114. }
  115. if (checkBox12.Checked == true)
  116. {
  117. float B12 = 1;
  118. }
  119. if (checkBox13.Checked == true)
  120. {
  121. float B13 = 1;
  122. }
  123. if (checkBox14.Checked == true)
  124. {
  125. float B14 = 1;
  126. }
  127. if (checkBox15.Checked == true)
  128. {
  129. float B15 = 1;
  130. }
  131. if (checkBox16.Checked == true)
  132. {
  133. float B16 = 1;
  134. }
  135. if (checkBox17.Checked == true)
  136. {
  137. float B17 = 1;
  138. }
  139. if (checkBox18.Checked == true)
  140. {
  141. float B18 = 1;
  142. }
  143. string sb1 = "" + B1;
  144. string sb2 = "" + B2;
  145. string sb3 = "" + B3;
  146. string sb4 = "" + B4;
  147. string sb5 = "" + B5;
  148. string sb6 = "" + B6;
  149. string sb7 = "" + B7;
  150. string sb8 = "" + B8;
  151. string sb9 = "" + B9;
  152. string sb10 = "" + B10;
  153. string sb11 = "" + B11;
  154. string sb12 = "" + B12;
  155. string sb13 = "" + B13;
  156. string sb14 = "" + B14;
  157. string sb15 = "" + B15;
  158. string sb16 = "" + B16;
  159. string sb17 = "" + B17;
  160. string sb18 = "" + B18;
  161. // zapise text v riadkoch
  162. string[] lines = { sb1 , sb2,sb3,sb4,sb5,sb6,sb7,sb8,sb9,sb10,sb11,sb12,sb13,sb14,sb15,sb16,sb17,sb18 };
  163.  
  164. // nastavenie ukladania
  165. string docPath =
  166. Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
  167.  
  168. // vytvoti subor
  169. using (StreamWriter outputFile = new StreamWriter(Path.Combine(docPath, "WriteLines.txt")))
  170. {
  171. foreach (string line in lines)
  172. outputFile.WriteLine(line);
  173. }
  174.  
  175. }
  176.  
  177. }
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement