|
I tried it but it doesn't work.
if i have scrpit which has something
like this
<comment>This is tree.
This is a palace.
</comment>
your solution gives me
<comment>This is tree.&#xd;
This is a palace.
</comment>
When i use the msxml praser and parse the script i should get the same script before parsing.
The output should
<comment>This is tree.
This is a palace.
</comment>
Can u suggest me some other solution.
modified on Monday, February 23, 2009 7:10 AM
|
|
|
|
|
I'm not sure what you're saying. What do you mean by "output"; isn't the output of the parser simply the contents of the XmlDocument?
Perhaps you're still not explaining the problem clearly. Can you show some code?
|
|
|
|
|
Suppose i have xml file Test1(This is not created using dotnet parser) which contains the following.
"<Properties>
<Comment>
This is a test for the new block.
It should all be written on separate lines of text.
Using import from the client sometimes
will give you a double lined in new block.
</Comment>
</Properties>"
Now i am importing this file using my GUI.My GUI uses C# XMLDocument to parse file(Test1) and imports it into new dir (say NewDir).When i open this file from the NewDir the contents are as shown bellow.
"<Properties>
<Comment>
This is a test of the new block.
It should all be written on separate lines of text.
Using import from the client sometimes
will give you a double lined in new block.
</Comment>
</Properties>"
If u see the "
" is missing at the end of the each line.This is causing the problem.When the text under the comment tag is shown in our control a new line is added between the lines.
if the file contents of the file in NewDir is same as Test1.It is working fine.
Is there a way to get the contents exactly same as in the contents of Test1 using the XMLDocument class.
Please let me know if more clarification is required.
|
|
|
|
|
i'm trying to access the flash drive programatically, but first of all i want to know how to talk to usb port. any suggestions
|
|
|
|
|
I presume none of these links helped clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
One of the great misconceptions. USB is not a "port" like serial or parallel. It is a bus, like the expansion slots inside the machine. You don't talk directly to the "port". You talk to the devices plugged into it.
|
|
|
|
|
I download ur application and check with that .....when i execute this application i got the following message..
I Check with through given Application means I got below Message
=================================================================
Message : Phone Reports generic Communication error or syntax error.
I Check with through given GSMComm Library means I got below Message
=====================================================================
Message : Phone Reports generic Communication error or syntax error(GsmComm.GsmCommunication.CommException)
|
|
|
|
|
You need to post this as a comment on the article where you got the code - nobody has a clue what you are talking about otherwise.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi,
This is a really basic question, but I'm not sure how to rename my projects without copying over the whole project code and form controls into a project with a new name.
More specifically, I would like to change the names for #1 and #2 (see screenshot for what I mean).
http://img23.imageshack.us/img23/6536/projectnameqc8.jpg
#1 - would be the project name, which I'm not sure how to change with Visual C#. I've looked over some options, but no luck at all.. I tried to change them manually but that didn't work out too well either.
#2 - I think this is my registered name for Visual C#, and I have no idea how to change this. Do I really need to re-install for this?
Any help would be appreciated, and sorry for the basic question.
|
|
|
|
|
You can change the company name etc. in AssemblyInfo.cs of your project.
For changing the exe name, go to the Properties of the project and under the Application tab it is the "Assembly name".
|
|
|
|
|
Thanks! I was looking exactly for this. I didn't know that the executable could be changed without actually changing the project name.
|
|
|
|
|
Changing the assemby name or the root namespace in the properties tabs will update all the objects.
Basically I go to the properties tabs and change every instance I find, there are plenty of rocks that need to be turned to find the names.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hii
I want to add support of multiple languages in my windows application.
Please help me or provide any suitable link for this.
Thanks in advance
|
|
|
|
|
It is a big topic. Start with MSDN[^].
|
|
|
|
|
Hi Friends
I have two kind image buttons (like ZOOMIN and ZOOMOUT).i want to ,how to write the code for
switch case ?
|
|
|
|
|
You must do, those in case of the switch to declaration are just to offer the necessary judgment vessel. Exactly, remember that you express question future better offer perhaps then we is possible the answering which is better.
|
|
|
|
|
I need to be able to read and extract information from Windows' shortcuts. (The file being launched, and the comment.) Maybe I'm missing something really obvious, but I can't find a way to do this. (Honestly, how hard can this be? )
Thanks in advance,
Bobert
|
|
|
|
|
What do you mean, like a shortcut to your application or, all shortcuts?
|
|
|
|
|
You need to know the structure of that file to read and extract it's contents.
|
|
|
|
|
Windows shortcuts are exposed using the IShellLink interface.
The methods you need are GetPath and GetDescription .
«_Superman_»
|
|
|
|
|
I am making an application that is rendering timeline data. The data is simple - I have an array of Events, Event being a class I've defined with several simple properties.
One of the properties that I'm trying to define is the relationship an individual Event has with other events. Basically, I want some events to be Parent events, and others to be children of those parent events.
How do I define a property that is a pointer to another instance of a class of the same type? In C#, you can't use pointers to classes that contain managed types, so that doesn't seem like an option.
I suppose I could create several arrays, each one representing a parent class, with the parent class being the zeroth element and child classes following the zeroth element, but I was hoping to simplify the data by making one big Array of Events and having each element contain relational data.
Thanks!
|
|
|
|
|
You use a reference. You have already used them, an array of Event is actually an array of references to Event objects.
You can use a parent referene:
public class Event {
public Event Parent { get; set; }
}
Or you can have a list of children:
public class Event {
private List<event> _children = new List<event>();
public List<event> Children { get { return _children; } }
}</event></event></event>
Or you can even have both a parent reference and a childrens list. It depends on how you are going to use it. If you have only a parent reference you have to loop through the array to find a child, and if you only have a childrens list you have to loop through the array and loop through the children of each item to find a parent.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You should try to implement a composite pattern (which is exactly what the other user suggested), a tree structure for representing hierarchies.
This article contains a complete sample[^]
Calin
modified on Wednesday, February 18, 2009 7:37 PM
|
|
|
|
|
Hello,
I have few UserControls and one Form. In my application I switch the Controls depending on user work. Creating of these Controls is to much time-consuming. I need a method to pre-create this Controls for example in Idle or another Thread. The Idle event blocks the user work and creating Controls in another Thread throws exception "Cross-thread operation not valid".
Do you have some idea how to do it?
Thanks, Vodpik
|
|
|
|