|
I just found that the & sign doesn't change into & until I convert it to XML, can anyone give me some insight why that is happening?
T
|
|
|
|
|
Hi,
Not quite sure what you mean, but it may be to do with using the & symbol to escape the string. You may have to use & to represent an &
Because certain symbols are reserved, when you want to use them in strings you have to escape them.
Hard to explain, take a look here:
http://www.w3schools.com/xml/xml_cdata.asp[^]
.. not that I've ever found the w3c explanations of anything easy to understand.
Regards,
Rob Philpott.
|
|
|
|
|
I assume you're only detecting this when reading the file back? Or are you opening the file with an editor?
At any rate, your question is unclear, it's possible that you're typing one thing and another is displaying in the message.
It might be better if you showed us the code that writes the file.
At any rate, I've found that using an XmlDocument to write he file is much better than trying to use Write or WriteLine to manually create the file.
|
|
|
|
|
I binded an employee class to the propertygrid control in C#. It's now displaying as follows:
MiddleName
FirstName
LastName
Age
ID
How can I show ID at the very top, then lastname, first name and middle name. I didn't find any property that could do. Is there something i am missing.
thanks
|
|
|
|
|
When you bind an obect to a property grid, it uses reflection to walk through the properties exposed on the object. I would hazzard to guess, based on the little bit of data you provided, is that those are the order that the properties exist in your Employee Class ??!!
One thing to do is to try changing the order. There are also a number of decorators you can use to help with what the property grid exposes. For example [Description()] will populate the decriptor box at the bottom of the property grid when you click on the field. Most of the behavior is not controlled by properties on the grid, but rather the decorators on your fields.
|
|
|
|
|
|
Dear all,
In my program, I have written a method to send out an e-mail. However, my entire GUI freezes for a moment until the e-mail has been sent. I would like to create a worker thread that sends the e-mail ( invoke the method from that thread ) so that my main GUI stays alive and functional.
I've looked through many examples on the net, but they are all a bit of an overkill. I remember there was an easy way of doing it. Can anyone please point me in the right direction.
Cheers,
Rick
|
|
|
|
|
Well, generally speaking, multi-threaded applications are not that simple. However, you can use the BackgroundWorker or ThreadPool, those are the easiest to deal with, especially suitable in situations like yours.
Check thisout:
If you still have issues post back
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed.
Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Coo
|
|
|
|
|
Mustafa Ismail Mustafa wrote: However, you can use the BackgroundWorker or ThreadPool, those are the easiest to deal with, especially suitable in situations like yours.
Wha??? See my post. I dont understand why people want to revert to monsters!
|
|
|
|
|
Hmmm, live and learn. I've never actually had to send an email through C#. Thank you leppie, much obliged
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed.
Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Coo
|
|
|
|
|
leppie wrote: I dont understand why people want to revert to monsters!
OK - I now have an image of Scooby Doo in my head and it's not going away. Thanks for that.
|
|
|
|
|
SmtpClient.SendAsync() , make sure you attach to the SendCompleted event if you want to know it has finished.
|
|
|
|
|
Hello,
I have several precompiled binaries(but not the code) and am looking to make
a GUI to make the use of these binaries more user friendly. I was going to
call the binaries by using createprocess but the problem is when the binaries
run the command propmt flashes up and sort of makes the GUI look messy.
Is there a way I can call these binaries and request that their window/prompt
is not visible?
Thanks
|
|
|
|
|
ProcessStartInfo.CreateNoWindow = true;
|
|
|
|
|
Ylno wrote: I have several precompiled binaries(but not the code) and am looking to make
a GUI to make the use of these binaries more user friendly. I was going to
call the binaries by using createprocess but the problem is when the binaries
run the command propmt flashes up and sort of makes the GUI look messy.
Is there a way I can call these binaries and request that their window/prompt
is not visible?
Yes. Set the CreateNoWindow property in your Process StartInfo to true. See below.
Process cmdLineProcess = new Process();
cmdLineProcess.StartInfo.CreateNoWindow = true;
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Without looping over each element to copy them is there any way I can get a row of a 2d array into a 1d array?
ie something like this, except that would actually be able to compile:
object[,] 2dArray = Get2dArray(...);
object[] 1dArray = 2dArray[1];
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
What if you declare it as an array of 1d arrays, as follows:
object[][] 2dArray ... Obviously this only works if you have control over the return type of "Get2dArray", but you get the idea. I also don't know if you can cast an object[,] into an object[][] or not, but you could try it. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I have control over the array source, but jagged arrays don't appear to play nice with COM (methods taking one as a parameter don't show up even with [ComVisible (true)] ), and I can't cast the one of the two types of arrays into the other.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
Hmm... I can't think of anything else to try to get a one dimensional array. In C++ you could get a pointer to the first object of the array, then pass that pointer along with the length of your 1d array to a method. However, in C#, you can't have pointers to managed types (that I have actually been able to code). I would look into the "fixed" keyword and perhaps pass pointers instead of arrays, or change your language to C++, or just copy the contents from your 2d array to a 1d array. Hopefully someone else will have more ideas for you.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Use C, I believe you can address a 2D array like a 1D array.
Seriously though, Array.Copy might work.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Use C, I believe you can address a 2D array like a 1D array.
Except for the COM wrapper the code's already been written in C# so changing the language isn't an option and learning c++.net just to write a slightly cleaner wrapper'd be overkill in terms of time spent. Seriously though, this is probably the first time in at least a year, maybe two where I've found myself thinking "dang, this would've been so much easier in C++".
Ennis Ray Lynch, Jr. wrote: Seriously though, Array.Copy might work.
Nope, the dimensional jackboots are still firmly in place.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
I always thought it was a mistake the way C# does array indexes. I think they intentionally removed this ability. I just tried a few things I could think of and nothing really worked to well. I suppose you can use unsafe code and cast to get to it?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Yeah, perhaps a little too strongly typed.
|
|
|
|
|
At least its not ada.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
hi,
i installed visual studio .Net 2005.how i can work on the visual web developer ? and how i can open the ASP.NET Web application template?
|
|
|
|