|
does it need any loop??
cause wat in my mind is the game maybe have 1-4 player, so let said in this round have
3 players
player:1
NAme:A
Position:10
Movestep:2
player:2
NAme:B
Position:8
Movestep:2
player:3
NAme:C
Position:7
Movestep:2
-- so i was thinking to use the x value to loop 3 times since got 3 player
and read 4 line accordinly.... am not sure can it work but i only know a bit on using the readline, i never write it in xml b4..not really understand how it work ..
|
|
|
|
|
campbells wrote: does it need any loop??
Nope. You don't need to worry about how many players are in the file or parsing each and every line. The Serializer takes care of all of this for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
do u have more example or article about this xml thing?
|
|
|
|
|
i wonder is i have 3 player i do i read the first line to get how many player at that time???
cause i jsut understand is will recall the player status part but how it know how many times to loop it?
|
|
|
|
|
Your not listening... Doing it using a Serialization method frees you having to loop anything while reading the file. The Serializer takes care of that for you!! All you need to do is check the Bounds of the array to get the number of Players in it after the Players array is recreated.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sombody was asking about how to do this before and i cant remember where they posted, but i know it was for vb.net so here is the code to get the IP address and port from a TCPClient...ideas came from some other posts on this sight and where modified to work with VB instead of C# and i also added the AddressInfo class...hope this helps someone
=============================================================================
Imports System.Net
Imports System.Net.Sockets
Imports System.Reflection
Public Class NetworkUtils
Public Const kLineEnd = 10
#Region "AddressInfo"
Public Class AddressInfo
Private m_IP As String
Private m_Port As String
Public Sub New()
m_IP = MyIP()
m_Port = "999"
End Sub
Public Sub New(ByVal theIP As String, ByVal thePort As String)
m_IP = theIP
m_Port = thePort
End Sub
Public ReadOnly Property IP() As String
Get
Return m_IP
End Get
End Property
Public ReadOnly Property Port() As String
Get
Return m_Port
End Get
End Property
End Class
#End Region
Public Shared Function AddressInfoFromTCPClient(ByRef theClient As TcpClient) As AddressInfo
Dim theAddress() As String = CType(theClient.GetStream.GetType.GetProperty("Socket", BindingFlags.NonPublic Or BindingFlags.Instance).GetValue(theClient.GetStream, Nothing), Socket).RemoteEndPoint.ToString.Split(":")
Return New AddressInfo(theAddress(0), theAddress(1))
End Function
Public Shared Function MyIP() As String
Return System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0).ToString
End Function
End Class
Pablo
|
|
|
|
|
Don't post it here. Noone ever searches the comments and it'll be a couple pages back in a few days...
Write up an article on the technique, commenting on how you did this, what parts of the code do what, why it's a good idea, and post it!! That's what CP is here for!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's a simple questions, when and where do you use try/catch blocks? Does anyone know of an artical that covers the basic dos and don'ts of try/catch block.
|
|
|
|
|
spoodygoon wrote: Does anyone know of an artical that covers the basic dos and don'ts of try/catch block.
Go to the top of your browser screen, and type in try catch into the Search text box, then press the Go button. You'll find many articles.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
It's mainly used to catch/handle Exceptions Especially used when the coding has got interaction with the database connections
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
How can i get status how long is the user online, how much did he dll and upload...
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
hi! i'm developing a very simple app that for any reason consumes a lot of memory, and i would like to know how to reduce the memory used at runtime by the app...
for example, when i build the solution and the main form shows up, the app "sucks" 30 MB...then, for each form i open, 10-15 MB extras are consumed...but when i close each of these opened forms, the memory doesn't get freed...
if it is useful, each of this forms are opened as an opendialog form, which then i close using the form.dialogresult=cancel .... i don't know if i'm missing something or what...
well, that's all!
p/d: the only thing i do is load and close the forms, i don't even open any file or something like that....
|
|
|
|
|
Are you running in debug mode?
And what do you have on your forms? What do you do on the individual forms?
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You shouldn't be using TaskManager to see how much memory your app uses. TaskManager will show you the total size of the entire .NET CLR Virtual Machine that your code is running in, not the actual memory used by your code.
If you want accurate numbers, you'll have to use Performance Monitor and the .NET CLR Memory counters.
TaskManager is showing how much memory is being used by the CLR, including all the memory that is "reserved" for future use by code running inside it. The CLR allocates more memory than is needed so future object allocations by your code will be serviced faster. Without this, your code would have to wait until the CLR grabbed a block of memory from Windows, added it to the Managed Heap, then allocated your object. Since the memory is already in the Managed Heap, there allocation get processed much quicker.
So, is this memory "permanently" allocated to the CLR?? No! If Windows needs some memory returned to it, the CLR is smart enough to free up what it has in reserve and return however much memory Windows needs.
If you want to know about the in's and out's of Managed Memory and Garbage Collection, read this[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
well...thanks a lot for both replies....they helped me to understand the issue...now i'm going to read the article you posted dave...thanks a lot!
|
|
|
|
|
help me in making code for button when i click it first time the text become bold and click it second time it become normal or regular please help me in VB.net code
zabsmarty
|
|
|
|
|
Define two vars
Dim fntBold As Font<br />
Dim fntNorm As Font
In your form load event:
fntBold = New Font(Button4.Font, FontStyle.Bold)<br />
fntNorm = New Font(Button4.Font, FontStyle.Regular)
and in your button click event:
If Button4.Font.Bold() Then<br />
Button4.Font = fntNorm<br />
Else<br />
Button4.Font = fntBold<br />
End If
Roy.
|
|
|
|
|
i want idea for making new IDE tell me the problem that face peoples tell me the oprnsource for IDE . please reply me soon
zabsmarty
|
|
|
|
|
Take a deep breath.
Concentrate.
Rewrite your post becouse nobody knows what you want.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
IDE could mean alot of stuff
what IDE are you reffering to?
\\\\\\\\
--------o)>>>
////////
|
|
|
|
|
My problem is that my IDE won't make me coffee.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: My problem is that my IDE won't make me coffee.
I'd like that, too. Also, I'd like to telepathically control my IDE
Paul
|
|
|
|
|
I need to create a CSV file on the fly. To input info to feed a diffrent programs software that only excepts CSV. Maybe its easy but im lost
|
|
|
|
|
A CSV file is just a normal text file that has each individual field of a record seperated by some character, usually a comma. Text fields are also, optionally, encased in double quote marks:
EmployeeID,EmployeeName,HourlyRate
1,"Schmoe, Joe",28.50
2,"Schmuckatelli,Alfonso",13.50
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 15:43 Monday 20th March, 2006
|
|
|
|
|
Yes about 5 min after i wrote the question I got it to work thank you
|
|
|
|