示例#1
0
    void Start()
    {
        active = new List <GameObject>();
        logged = new List <packet>();
        ReadInPackets rip = new ReadInPackets("Assets/PacketData/test.csv");

        queued = rip.packetLst;
        initPorts();
        print(true);
    }
示例#2
0
    static void readInFiles()
    {
        FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://192.168.1.1/");

        request.Method = WebRequestMethods.Ftp.ListDirectory;

        FtpWebResponse response       = (FtpWebResponse)request.GetResponse();
        Stream         responseStream = response.GetResponseStream();
        StreamReader   reader         = new StreamReader(responseStream);
        List <string>  directories    = new List <string>();

        string line = reader.ReadLine();

        while (!string.IsNullOrEmpty(line))
        {
            directories.Add(line);
            line = reader.ReadLine();
        }
        reader.Close();

        using (WebClient ftpClient = new WebClient())
        {
            for (int i = 0; i < directories.Count; i++)
            {
                if (directories[i].Contains("hello"))
                {
                    string path     = "ftp://192.168.1.1/" + directories[i].ToString();
                    string transfer = @"C:\Users\Sara\Documents\Visual Studio 2015\Projects\CodeCamp\CodeCamp\Assets\PacketData\" + directories[i].ToString();
                    ftpClient.DownloadFile(path, transfer);
                }
            }
        }

        response.Close();

        for (int i = 0; i < directories.Count; i++)
        {
            if (directories[i].Contains("hello"))
            {
                ReadInPackets rip    = new ReadInPackets(@"C:\Users\Sara\Documents\Visual Studio 2015\Projects\CodeCamp\CodeCamp\Assets\PacketData\" + directories[i].ToString());
                List <packet> pktLst = rip.packetLst;
            }
        }
    }
示例#3
0
    void addPackets()
    {
        ReadInPackets rip = new ReadInPackets("Assets/PacketData/test.csv");

        queued.AddRange(rip.packetLst);
    }