Skip to content
WJunction - Webmaster Forum

C# public void ... help

Status
Not open for further replies.

cgworld

Experienced Member
566
2010
9
i just cant find a way to call a void fun on events like connection lost or creation...
public void checkiftherisconnection()
{
Monitor the sock IO
}
private void Form1_Load(object sender, EventArgs e)
{

}

I hope you get me ...

Thanks
 
Last edited:

1 comment

if its part of the same object / class then just use:

Code:
this.checkiftherisconnection();

but with your naming of the method it seems you want to return a bool rather than void.

Code:
public bool checkiftherisconnection()
{
    return this.is_connected;
}

then in your event method use the above this.checkiftherisconnection() within an if statement,
 
Status
Not open for further replies.

About the author

C
Experienced Member · Joined
566
Messages
9
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom