Reputation: 1
The order of operation of my program is (Create file through dll call -> Read created file)
But it doesn't work.
After calling dll, the ReadAllLine function does not work and enters an infinite wait state. The cpu used is also 0.
How do I run a function and read a file?
[DllImport("Pcap_Parsing.dll", EntryPoint = "DEC_Parsing", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
string FilePath = "file~~~/~~~/~~~.pcap"
string[] FileLines;
public static extern void DEC_Parsing(string fn);
Parsing(FilePath); //file create test.ini
FileLines = System.IO.File.ReadAllLines(~~~~path/test.ini); //When this function is executed, the cpu usage becomes 0 and it is in an infinite wait state.
Upvotes: -1
Views: 56
Reputation: 11
pcap files aren't a text file I think it is hard to use a method reads lines to string[]. try this without parsing it might work as all files saved on the devices are binaries.
[DllImport("Pcap_Parsing.dll", EntryPoint = "DEC_Parsing", ExactSpelling =
true, CallingConvention = CallingConvention.Cdecl)]
string FilePath = "file~~~/~~~/~~~.pcap"
string[] FileLines;
public static extern void DEC_Parsing(string fn)
{
var FileLines = System.IO.File.ReadAllBytes(filePath);
string fileDecode = Encoding.ASCII.GetString(FileLines);
}
Upvotes: 0