Shashwat Rohilla

Member
  • Content count

    49
  • Joined

  • Last visited

Community Reputation

130 Neutral

About Shashwat Rohilla

  • Rank
    Member
  1. How to restart a Thread in C# .Net 4.0?

    I have a thread which is started when the user clicks the 'Start' button. Actually this is implementing a server which initializes a socket and then loops the [i]socket.Accept()[/i]. I want to allow the user to stop the server, thus closing the thread; and then restarting it any number of times.
  2. I'm using C# .Net4.0 in VS 2010. How do I restart a Thread? Its like I want to Abort() the thread and Start() it from the beginning again? Is it possible?
  3. How to restart a Thread in C# .Net 4.0?

    sorry for posting it in the wrong section... how to delete this?
  4. I'm using C# .Net4.0 in VS 2010. How do I restart a Thread? Its like I want to Abort() the thread and Start() it from the beginning again? Is it possible?
  5. I'm using .Net 4.0 in VS 2010. I can retreive the IP Address of my machine as [i]string hostname = Dns.getHostName();[/i] [i]IPHostEntry host = Dns.getHostEntry(hostname);[/i] Now [i]host.AddressList[/i] is an array of IPAddresses. I noticed that AddressList[0] contains nothing, AddressList[1] the loopback address. I'm not sure about other indices. If I have created a server on one machine and it wants to populate its IP to client (may be the machine only), then which IP (among host.AddressList) shall I populate? Which index to use? How do I know whether I'm connected to a LAN or the internet, or not connected at all? Please clarify.
  6. How to use .Net (C#) classes to generate XML strings?

    [quote name='Telastyn' timestamp='1330450190' post='4917438'] The XmlSerializer and Deserializer are what you're looking for. [/quote] I saw them, they also require those Streams. I do not want to include any files in these. The jochen's is exactly I was looking for.
  7. How to use .Net (C#) classes to generate XML strings?

    thank you jochen.. it worked absolutely fine... I just had to include System.Xml.Linq..
  8. C# I want to send an XML string over network and then parse it using predefined XML classes. I tried XmlTextWriter, but it asks to a Stream object to initialize. I can have Console.Out there as XmlTextWriter textwriter = new XmlTextWriter(Console.Out); then I can use [i]textwriter.WriteStartDocument() textwriter.WriteEndDocument() textwriter.WriteStartElement() textwriter.WriteEndElement()[/i] methods. But still I didn't find any way to convert it to string or byte[] to send it to socket. Also I didn't find any way to parse the XML data using these classes. Please help!
  9. Setting the Viewport for rendering

    It helped me. I was able to create two different viewports. But I wanted to color both of them with different backgrounds. I used GraphicsDevice(Color.Green) after setting it to different viewports but it renders the whole window (not just the specified viewport).
  10. I'm using XNA 4.0 in VS 2010 Please tell me how to set a particular part of the screen for rendering. eg I want to use 70% of the screen for 3D rendering (left side) and rest 30% (right side) for displaying the scores and other information. I tried to use change some variables but they were all read-only. Thanks
  11. Designing with Threads

    [quote name='freddyscoming4you' timestamp='1312557240' post='4845044'] You need to call InvokeRequired() on the control in question. For example, label1.InvokeRequired() and if true you fire off a delegate call with the same control's .Invoke(delegate) method. If the control has a BeginInvoke you can use that as well. You just need to choose if you want an asynchronous call or not. [/quote] Already did that.. Now its working fine... We can not create or update a UI component in a thread other than main thread. Thanks for telling..
  12. Doubt in VS 2008

    [quote] Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on machines which don't have VS 2008 installed.[/quote] By VS 2008, do you mean .Net framework? [quote] Release - This is what you will provide your players/users. No requirement for VS 2008. [/quote] Will this run without .Net framework?
  13. Difference between Game Engine and APIs

    I'm quite clear about Game Engine and APIs. Please answer my two questions :- [color="#ff0000"]Is XNA a game engine? [/color][color="#ff0000"]Are drivers the *.dll files which interact with the hardware?[/color]  
  14. What is the difference between a Game Engine and an API? I read that Game Engine helps in the development of games. Is OpenGL a game engine? I think it is an API. Is XNA a game engine? Moreover, are drivers the *.dll files which interact with the hardware?
  15. Doubt in VS 2008

    Thanks all