|
Voted 1 because:
a) we don't do your homework for you
b) you've posted this before
c) the problem is really neither interesting or all that advanced
If you're really stuck start with the MSDN documentation for the string class. You might also find the Regex class and the DateTime class useful.
Show that you are actually making an effort and somebody can problem help you with specific problems.
-- modified at 11:28 Thursday 11th May, 2006
|
|
|
|
|
d) it is the second time he posts the same question.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
|
crap, I missed this one!!
I stand corrected.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
e) It's also the second time he posted it
|
|
|
|
|
No... You sit, corrected twice.
--
I've killed again, haven't I?
|
|
|
|
|
|
I would have to say that the most interesting aspect to this post is that you are a 3rd year computer student and yet you do not know how to parse a string. By my third year I was writing compilers and operating systems. I highly recommend you consider a new career path. We definitely don't need more developers like you around. You got a 1 vote from me.
|
|
|
|
|
|
Hi all,
I am looking to extract data from an xml config file and place the values in an array.
Extract:-
<languages>
<key="english" value="eng">
<key="spanish" value="esp">
<key="ukranian" value="ukr">
.... ....
<languages>
I need to take the values an place in an array. So far I cannot even figure out how to acees the data in the <languages> section of the config file.
Any ideas???
Seán
|
|
|
|
|
Hi all,
I am looking to extract data from an xml config file and place the values in an array.
Extract:-
<languages>
<key="English" value="eng" />
<key="Spanish" value="esp" />
<key="Ukranian" value="ukr" />
.... ....
<languages/>
I need to take the values an place in an array. So far I cannot even figure out how to acees the data in the <languages> section of the config file.
Any ideas???
Seán
-- modified at 8:28 Thursday 11th May, 2006
|
|
|
|
|
Put them in the app settings part of the file.
|
|
|
|
|
I already have attributes in the app settings part of the file. For these particular att. I need to extract their values and put them into an array.
The number of attributes is not static so I cannot place them in an array using their keys.
Is there any other way???.
|
|
|
|
|
try this,
ArrayList array = new ArrayList();
XmlNode node = doc.SelectSingleNode("*/langauges");
foreach (XmlNode n in node.Nodes)
{
array.Add(n.InnerText);
}
Good luck!
eric feng
|
|
|
|
|
Hi
I am trying to create a socket for listening form my machine as a server.
Could somebody tell me why there is an exception "An invalid argument was supplied" in the last line below?
IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint localEndPoint = new IPEndPoint(ipAddress,myPort);
Socket listener = new Socket(AddressFamily.InterNetwork,
aSocketType.Stream, ProtocolType.Tcp);
listener.Bind(localEndPoint);
Socket acceptedSocket=listener.Accept();
Thanks
Ela
|
|
|
|
|
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, myPort);
eric feng
|
|
|
|
|
Thank you, it works.
e_LA
|
|
|
|
|
|
hi
tray this
for(int i = this.checkedListBox1.Items.Count-1; i >= 0; i--)
{
string txt = (string)this.checkedListBox1.Items[i].ToString();
if (txt.Equals(string.Empty))
this.checkedListBox1.Items.RemoveAt(i);
}
regards
joe
|
|
|
|
|
Hi
iam new to c# , can any one help me in adding a panel of specific size automatically to a tabpage when a new tabpage is created .
thanks in advance
Regards
praveen
|
|
|
|
|
Do you mean programatically or at design time?
|
|
|
|
|
|
Hello, could use a bit of general advice. I’m working on a C# program with Managed DirectX visualization. The main program window is divided into the visualization part and some generic controls from System.Windows.Forms for input – text boxes, drop down combos, grids and the like.
The DirectX visualization is quite complex so the typical frame rate is quite low especially on lower-end machines. My problem is that input becomes very sluggish and unresponsive as the frame rate drops. In extreme cases, pressing a key will cause a repeating string of characters to appear in the text box after significant delay. The frame rate I don’t really care about but the input has to stay responsive even on slower machines.
My guess is that the rendering is prioritised over the handling of control evens such as typing text. I have tried two solutions: one is peppering the main rendering loop with Application.DoEvents() to process the input control events. This had almost no effect.
Second is separating the rendering into a different thread to the main UI (essentially the render loop runs in a separate thread). However, even after setting the thread priority on the render thread to lowest and on the UI to highest I still get very sluggish input. I’ve removed all of the lock() statements to make sure the threads were not waiting on each other with no effect.
Didn’t have much luck finding a solution on the net – although surely this must be a very common problem. Can anyone suggest a solution - preferably one that doesn’t involve multithreading or writing DirectX input controls?
Thanks very much for any suggestions, apologies if I've posted in the wrong forum.
|
|
|
|
|
We have a C# program that does 3D animation of using Managed DirectX 9. Like you we have a 3D visualization window and some other Windows Forms controls on the main application window. We have found our performace quite good with this setup.
Try rendering each frame on the UI thread. Try a tight game loop setup rendering a frame then w checking the message queue for mouse clicks, button pushes, etc. I would also recomment doing away with Application.DoEvents() and using P/Invoke to check the message queue. Application.DoEvents() leaks memory with each invocation. A loop looks like the following:
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential)]
public struct MSG
{
public IntPtr hwnd;
public uint message;
public IntPtr wParam;
public IntPtr lParam;
public int time;
POINT pt;
};
public class RenderLoop
{
[DllImport("user32.dll")]
public static extern bool PeekMessage( out MSG msg, IntPtr hwnd, uint wMsgFilterIn, uint wMsgFilterOut, uint wRemoveMsg );
public RenderLoop()
{
Application.Idle += new EventHandler( this.Application_Idle );
}
private bool AppStillIdle
{
MSG msg;
return (!PeekMessage( out msg, IntPtr.Zero, 0, 0, 0 ) );
}
public void Application_Idle( object sender, EventArgs e )
{
while( AppStillIdle )
{
RenderFrame();
}
}
}
So each time your application gets an idle message you will render frames until the next UI event comes to your message queue. The application will process this event, then go back into the Application_Idle method and continue rendering frames until the next mouse click, etc.
I hope this helps.
Deus caritas est
|
|
|
|
|
Thanks. However - this is exactly the render loop I used to start with, from Tom Miller's blog. It works well down to 20-30 fps but the controls get sluggish when the frame rate drops below that and the whole thing grinds to a halt at 1-5 fps with input essentially no longer possible.
My understanding is that this is beacuse the whole thing is done in one thread - so once we start rendering, the next message is not processed until the rendering is complete. In other projects (where there was a background CPU intensive task running) I just separated the intensive task into a worker thread and the UI controls responded fine. I was wondering whether it was something DirectX specific that prevents threading from working correctly.
-- modified at 12:53 Thursday 11th May, 2006
|
|
|
|