|
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
|
|
|
|
|
Hi,
AFAIK you can't, and IMO you should not even want that. If creating your user controls is time consuming I expect at least one of the following:
1. you did something wrong, making the initialization too slow (e.g. not using SuspendLayout/ResumeLayout when adding lots of items to a listing control)
2. you designed an unrealistic control (too many controls, say 50 or more, in one user control); try changing your design, use listing controls (ListBox, ListView, etc) rather than large numbers of simple controls.
3. you are spending lots of time in getting the data to initialize the controls (e.g. due to networking,
slow web access, slow database access). Start using separate threads to obtain the data, then use Control.InvokeRequired/Control.Invoke to apply the data.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:17 AM
|
|
|
|
|
Hey, my name is Yahav and i am a .NET programer (and PHP expert but never mind...)
In my currect program, i am tring to connect to my website SQL server (server type - mySql).
i have downloaded the dll C# lib to do that connect and i have got mySQL "test connection program" who checks the sql connection and give me to edit the program
the link to download: http://dev.mysql.com/downloads/[^]
the problem is when i entering my host address (pearservices.com) or the ip address 62.90.136.206 i got error: "host address {my home address} could not connect to this SQL server."
({my home address} = my home ip address)
but when i entering localhost (mean my own mysql server that i have insalled on my computer) its works very well
someone can explain me why i get this error, and how can i connect to remote server, if this is a problem with my website host, do you have a hosts that give me the abillty to do that?
thanks you very motch, Yahav.
P.S.: Sorry, my engish is not very well.
Gindi Bar Yahav - Web & Software defeloper.
|
|
|
|