Thursday, April 12, 2012

How can I use server side file to track users who must interact with one another? ASP.NET/C#

I'm running Visual Basic '08 and using C# code. I am using forms however, but it is browser based. I'm using StreamReader and StreamWriter to read and write information to the server side file. The situation is a TicTacToe game, so the rules are clear, and there are 9 buttons, when a button is pressed, the text on it changes accordingly to the player's X or O. The game is played on two browsers or tabs, so the browser must interact with the server.

I really want to know how I can keep track of the moves each players has taken by reading and writing data from server side file to so then I can check for winner. I am saving the game data into a text file, that's the server side file I'm talking about.

Thanks for your time.

1 comment:

  1. Use a MessageBus to publish and subscribe messages:

    Here is a great article, right up your alley about how a system can deal with two player communication using the MessageBus: