C# .NET - Presence - Asked By Austine on 16-Feb-12 12:26 PM

Hi , Please can i help on how to code presence using C# window forms to know when somebody is Online,offline,

available , busy etc using C# window forms.

i know is possible to but don't know how.

Please help

[)ia6l0 iii replied to Austine on 16-Feb-12 12:52 PM
Polling at regular intervals is the only way to figure out if the user is online. Or if the user has explicitly logged out, then a notification can be sent to the client program.
kalpana aparnathi replied to Austine on 16-Feb-12 01:40 PM
hi,

It would seem that this issue is not specific to code review. Type inference would present the same difficulties for writing the code in the first place, and for debugging. The solution to these problem is using good programming practices. Be disciplined, refactor your code to make sense, take small steps when you change your code, and test it after each change.

Regards,
dipa ahuja replied to Austine on 18-Feb-12 12:59 PM
Step1: Take a Image control near the dropdown List
<asp:Image ID="Image1" runat="server" Height="20" Width="20" ImageAlign="Bottom" />
<asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" 
    onselectedindexchanged="DropDownList1_SelectedIndexChanged">
    <asp:ListItem>Available</asp:ListItem>
    <asp:ListItem>Busy</asp:ListItem>
    <asp:ListItem>Invisible</asp:ListItem>
  </asp:DropDownList>
  
Step 2: Implement the DropDown's SelectedIndexChange Event
  string status=DropDownList1.SelectedValue.ToString();
 
  if (status == "Available")
  {
    Image1.ImageUrl = "status/available.jpg";
  }
  else if (status == "Busy")
  {
    Image1.ImageUrl = "status/buzy.jpg";
  }


hope this will help you!