Advertisement
Guest User

resendblabla

a guest
Jun 28th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.49 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace RTMResendStrul
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             try
  11.             {
  12.                 string path = AppDomain.CurrentDomain.BaseDirectory;
  13.                 int counter = 9999113;
  14.  
  15.                 String[] text = File.ReadAllLines(path + "\\RTMTest.txt");
  16.                 for (int i = 0; i < text.Length; i++)
  17.                 {
  18.                     //Skrive header til .MSG
  19.                     string[] line = text[i].Split(null);
  20.                     string posnr = line[0];
  21.                     int[] bong = new int[line.Length];
  22.                     TextWriter xuids = new StreamWriter(path + "\\" + counter + ".MSG");
  23.          
  24.                     xuids.WriteLine("TO POS " + posnr + Environment.NewLine + "FROM BO" + Environment.NewLine + "TYPE RESENDLIST" + Environment.NewLine + "###");
  25.  
  26.                     bong[0] = int.Parse(line[1]);
  27.                     bong[1] = int.Parse(line[2]);
  28.  
  29.                     int forste = bong[0];
  30.  
  31.                     int antall = bong[1] - bong[0] + 1;
  32.  
  33.                     for (int g = 0; g < antall; g++)
  34.                     {
  35.                         xuids.WriteLine(forste + g);
  36.                     }
  37.  
  38.                     xuids.Close();
  39.                     counter++;
  40.                 }
  41.             }
  42.             catch (Exception e)
  43.             {
  44.                 System.Windows.Forms.MessageBox.Show(e.ToString());
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement