c# cannot be referenced from a static function -


c # newbie here.

It seems that this user has given me a very good solution to my problem:

But I have no clue how he suggests Gave. Can you please help?

This will compile properly, you will definitely have to give thePort .

  Namespace csWinFormsTest {public partial class} form 1: form {static system. Io Ports Prime port; Port; Public Form 1 () {Initialization (); ThePort = New System. IO.Ports.SierialPort ("COM1"); } Static zero fcn () {MessageBox.Show (thePort.PortName); }}}  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -