Advertisement
Guest User

READER

a guest
Oct 22nd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7. namespace OMG
  8. {
  9.     public static class Reader
  10.     {
  11.         public static List<string> FILEDATA;
  12.         public static void _READ()
  13.         {
  14.             FileStream fs = new FileStream(@"CR.NX", FileMode.Open);
  15.             FILEDATA = new List<string>();
  16.             int hexIn;
  17.             string FILE = "";
  18.             for (int i = 0; (hexIn = fs.ReadByte()) != -1; i++)            
  19.                 FILE += string.Format("{0:X2}", hexIn);            
  20.             for (int i = 0; i < FILE.Length; i=i+8)            
  21.                 FILEDATA.Add(FILE.Substring(i, 8));// de 8 en 8
  22.  
  23.             if (FILEDATA[0] == "4E583230")  //ES UN NX20            
  24.                 StepData.dType = "NX20";
  25.             else
  26.                 return;//NO PUEDO CONVERTIR OTRA COSA XOXOXO
  27.  
  28.             StepData._CLEAN();
  29.             StepData._PARSE();
  30.            
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement