I have a C # solution that contains a project and a class library written by someone else. The class library receives GPS data via Wi-Fi. The project shows the processed data on the map. Now I want to see the contents of some variables in the class library in real time for debugging purposes.
I tried to use
System.Diagnostics.Debug.Write(value)
without success. He seems to be doing nothing.
I also tried "MessageBox.Show (value.ToString ())", which was good, but it stopped reading Wi-Fi and interrupted the program, because I had to press the OK button every time it appeared.
In addition, I added a window shape (containing a text block) to the form library to print data in a text field, however, when I wrote:
Form1.textBox1.Text = value.ToString()
This gives me this error:
Error 3 "MapNMEA.Form1.textBox1" is not available due to the protection level C: \ Users \ john \ Documents \ Visual Studio 2010 \ Projects \ new ver of map purecom \ MapExplorer \ MapExplorer \ MapNMEA \ MapNMEA \ SerialPort. cs 184 27 MapNMEA
"MapNMEA" is the name of the class library. Also, "MapExplorer" is the name of both the solution and the project. "SerialPort.cs" is the file inside the class library in which I wrote the code above.
My question is how to show the contents of this variable (these are 3.4 variables) in real time, and this act should not stop reading Wi-Fi. I need to do this as an electrician who knows little about programming, wants to check whether the GPS device sends data correctly to my computer or not.
UPDATE 1 . In fact, I noticed that System.Diagnostics.Debug.Write(value) works, but since there were too many warning messages in the debug window, I did not notice this. Now, if somehow I can delete (or hide) other (warning) messages, I will only see my desired result. Did you know?