This project is read-only.

impossibility To dump packet in a File with object form

Feb 2, 2015 at 3:54 PM
hi everybody
I created a file trough the oject form. but my application threw exception: this is the cod
``` public partial class FormMain : Form
{
    private string fileToDump;
    private string folderGenitic;
private void FormMain_Load(object sender, EventArgs e)
    {


        if (allDevices.Count == 0)
        {
            MessageBox.Show(@"Aucune interface trouvée, assurez-vous que WinPcap est installé {0}","Info interface",
                MessageBoxButtons.OK,MessageBoxIcon.Information);
            return;

        }
        for (int i = 0; i != allDevices.Count; i++)
        {
            LivePacketDevice device = allDevices[i];    
            lstInterfaces.Items.Add(device.Description);
        }
        capturedPacket.Clear();
        folderGenitic = @"c:\Genitic\Files";
        System.IO.Directory.CreateDirectory(folderGenitic);

        string fileToDump = System.IO.Path.GetRandomFileName();
        folderGenitic = System.IO.Path.Combine(folderGenitic, fileToDump);
        //MessageBox.Show(fileToDump);
    }`
I call it here
private void Capturer()
    {

        PacketDevice selectedDevice = allDevices[_interfaceSelectionned];
        using (PacketCommunicator communicator = selectedDevice.Open(65536, PacketDeviceOpenAttributes.Promiscuous, 1000))
        {

               if( expressFiltre != null)
                {
                    communicator.SetFilter(expressFiltre);
                }

               using (PacketDumpFile dumpFile = communicator.OpenDump(fileToDump))
               {
                   while (_continuer)
                   {
                       communicator.ReceivePackets(0, dumpFile.Dump);
                   }
                   }
               }



        }
}
`` I only want to know can i creat a file to dump packets when i work with windows form?
Coordinator
Feb 6, 2015 at 12:35 PM
Hi Barack1234,

Can you post the exception details?

Boaz.