I'm getting an error in the code, how can I fix it?

adige

New member
Joined
Jun 30, 2024
Messages
1
Programming Experience
1-3
C#:
private void button2_Click(nesne gönderen, EventArgs e)
        {
 listBox2.Items.Clear();

Soket dinleyicisi = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Unspecified);
dinleyici. Bind(new IPEndPoint(Dns.GetHostByName(computerName). Adres Listesi[0], 0));
bayt[] invalue = yeni bayt[4] { 1, 0, 0, 0 };
bayt[] outvalue = yeni bayt[4] { 1, 0, 0, 0 };
dinleyici. IOControl(IOControlCode.ReceiveAll, değersizlik, değersizlik);
bayt[] arabellek = yeni bayt[1000000];
int read = dinleyici. Receive(arabellek);
if (okuma >= 20)
{
listBox2.Items.Add("Okunan paket bilgisi sayısı: " + okuma);
Dize bilgisi="";
for (int i=0; Okudum<; i++)
{
bilgi = bilgi + "("+tampon +")"+ ",";
} 
listBox2.Items.Add("elde edilen paket bilgileri: " + bilgi); 
listBox2.Items.Add(Encoding.ASCII.GetString(arabellek, 0, okuma)); 
Paketin içeriği önemlidir.!! İncelenmesi ve raporlanması tavsiye edilir
            }
            
        }
    }
}
 

Attachments

  • text.txt
    1 KB · Views: 2
Last edited by a moderator:
What error are you getting? On which line? What you tried on your own to fix the problem?
 
As an aside, the code you posted seems to be different than the code in the attachment.
 
Back
Top Bottom