Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. public void create()
  2.         {
  3.             string name;
  4.             Console.WriteLine("Wprowadz nazwę pliku");
  5.             name = Console.ReadLine();
  6.             byte[] a = new byte[10];
  7.             Console.WriteLine("Wpisz zawartość pliku");
  8.             string zawartosc;
  9.             zawartosc = Console.ReadLine();
  10.             a = Encoding.ASCII.GetBytes(zawartosc);
  11.  
  12.             try
  13.             {
  14.                 if (DISK[x] != 0)
  15.                 {
  16.                     x = x + 32;
  17.                     if (DISK[x] != 0)
  18.                     {
  19.                         x = x + 32;
  20.                     }
  21.                 }
  22.  
  23.  
  24.                 int r = 0;
  25.                 for (int i = x; i < (a.Length + x); i++)
  26.                 {
  27.  
  28.                     DISK[i] = a[r++];
  29.                 }
  30.  
  31.                 for (int indeks = 0; indeks < DISK_SIZE; indeks++)
  32.                 {
  33.                     Console.WriteLine(DISK[indeks]);
  34.                 }
  35.  
  36.                 zapisz(name, x, a.Length);
  37.             }
  38.             catch (IndexOutOfRangeException)
  39.             {
  40.                 Console.WriteLine("Nastąpiło właśnie przepełnienie indeksu");
  41.             }
  42.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement