Can any C-Sharp expert out there convert the C function below, into
C-Sharp code, that I can insert into an already-existing C-Sharp program, that will compile? Thanks.
I have an existing C code that compiles in the C environment. I want to insert this function into an already running C-Sharp program. Because I only have a week to get this done, learning C-Sharp at this time is not practical.
The C function is simple:
a) get the output of the ipconfig /all command, write it into a tmp file
b) read that file for the string "gateway.net" or for anything string
that contains the string "192.168.1"
c) if this is found, set found = 1
d) when done, delete the tmp file
e) if found == 0, stop the program
Below is that C function.
Check ( )
char str ;
int found = 0;
system ("ipconfig /all > c:\\temp\\tmp_file");
fi = fopen ("c:\\temp\\tmp_file", "r");
while (! feof (fi))
fscanf (fi, "%s", str);
if ((strcmp (str, "gateway.net") == 0) || (strstr (str, "192.168.1") != NULL))
found = 1;
if (found == 0)