|
Hi sandeep
sorry for disturbing you again and again
actually i want output as XML file having different elements with key value pair .
Thanks&Regards
RENU
|
|
|
|
|
OK But file is like this only key value seperated by : colon
need to develop logic its simple give some time
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
 Hi Renu here is your solution
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
StreamReader streamreader = File.OpenText(Server.MapPath("TextFile.txt"));<br />
XmlTextWriter xmlTextWriter= this.CreateXML();<br />
while (!streamreader.EndOfStream)<br />
{<br />
string line = streamreader.ReadLine();<br />
<br />
string[] values = line.Split(':');<br />
if(values.Length>1)<br />
writeElement(xmlTextWriter, values[0], values[1]);<br />
}<br />
this.EndXml(xmlTextWriter);<br />
xmlTextWriter.Close();<br />
}<br />
<br />
public XmlTextWriter CreateXML()<br />
{<br />
XmlTextWriter xTextWriter = new XmlTextWriter(Server.MapPath("Ouput.xml"), System.Text.Encoding.UTF8);<br />
xTextWriter.WriteStartDocument();<br />
xTextWriter.WriteStartElement("RootElement");<br />
<br />
<br />
<br />
return xTextWriter;<br />
<br />
}<br />
<br />
public void EndXml(XmlTextWriter xmlTextWriter)<br />
{<br />
xmlTextWriter.WriteEndElement();<br />
xmlTextWriter.WriteEndDocument();<br />
<br />
}<br />
<br />
public void writeElement(XmlTextWriter xmlTextWriter, string key, string value)<br />
{<br />
xmlTextWriter.WriteStartElement("Field");<br />
xmlTextWriter.WriteAttributeString("Key", key);<br />
xmlTextWriter.WriteAttributeString("Value", value);<br />
xmlTextWriter.WriteEndElement();<br />
<br />
<br />
}<br />
Expecting positive reply from you
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Dont you think you are spoon feeding Renu?
|
|
|
|
|
Hi Arti
I know its like that but i am here in CP to learn something. Renu wanted the solution from last 3 days i had given 2 days but Renu coudn't find the solution that's why i provided solution
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi sandeep thank you for sending solution.can we show the xml output like
staring and ending tags of each line is key and in between start and elements attribute as value
Ex:<key>value
Thanks&Regards
RENU
|
|
|
|
|
HI RENU
i Helped you as you were not getting solution from couple of days. It does not mean that i will provide you solution according to your requirement. Please find solution on google.
DON345 wrote: can we show the xml output like
staring and ending tags of each line is key and in between start and elements attribute as value
Ex:value
Yes you can do that just look at xmltext writer instead of providing Field as element name provide name you want
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hello...
I have a little problem with KeyDown event.
I'm using a Form with 1 TextBox.
If the textbox is focused, then event textbox_KeyDown will be called.
If the form is focused, then event form_KeyDown will be called.
What I want is:
If the textbox is focused, the event form_KeyDown must be called.
And idea how to do that ?
Thanks...
|
|
|
|
|
Have a look at Form.keypreview property 
|
|
|
|
|
Thanks.... It's so easy. Never used it before...
|
|
|
|
|
I've got a dataset that is populated by a 1000+ char SQL query, the amount of columns can be anything from 1 to 500. The columns has different headings.
I want to make a Report of this dataset, but it has to happen dynamically, each time the report will be different.
Is this possible ?
Thanks
|
|
|
|
|
Hi,
i have a requirement like to generate dynamic drodownlists based on the levels which r prasent in the levels table.i am successfully implemented dynamic controls.when ever we select the first dropdownlist based on the than value the corresponding data will be filled in the second dropdown list...like that remaing dropdownlists are filled.......when i am selecting the values in dropdown list the page is postback to server at that time entire page is refreshing im trying to avoid that one ........
please anyone kindly help me.if u think the question is incomplete, please let me know that.
vinay
|
|
|
|
|
i want to explorer Folder Option, Map Network Drive,Disconnect Network Drive, i use following code but not works?
System.Diagnostics.Process.Start("explorer.exe", "Map Network Drive");
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
You can use command "net.exe" from windows.
To connect :
net use h: \\MYNOTEBOOK\C$
To disconnect :
net use h: /DISCONNECT /YES
Use Process.Start to run that command.
|
|
|
|
|
Hello, I have a couple of doubts about sockets.
First one. When I use Listen method, which is the maximum value I can put to the parameter. Can I just use the integer maxvalue?
Second one. I have a while loop to receive data from a remote host. If the host is down, how can I control that? What is the condition to put in the loop? I tried Socket.IsBound and Socket.IsConnected.
Regards,
Diego F.
|
|
|
|
|
First one:
"To determine the maximum number of connections you can specify, retrieve the MaxConnections value"[^]
Second one:
The Connected[^] property gives you the status of the socket at the last Send/Receive operation executed. You can use the return of the Poll method combined with other Properties of the socket to determine if the socket is down. Check here[^] for a table of input parameters and corresponding return values. A solution that's worked for me in the past was something like this:
if (socket.Poll(0, SelectMode.SelectRead) && (socket.Available == 0))
{
}
Hope this helps
|
|
|
|
|
Thank you. That's what I needed.
Regards,
Diego F.
|
|
|
|
|
Hi all,
how can i convert an array of bytes into an array of string in classic VB?
How can i use Peek and Poke in Classic VB?
Thanks in advance....
|
|
|
|
|
Are you asking classic VB question in C# forum? Unusual way to commit suicide...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
|
I'm looking to write a control (C#, Windows Forms, .Net 2.0) for displaying log messages. It should have to following characteristics:
1. Fast! Need to show lots of messages whizzing by in real-time - hundreds or more per second - messages will come out of a web service and I will need to query time ranges to replace existing messages in the control with, e.g. I'm currently showing messages from 10:00am until 11:00am, more messages come in and I now want my window to be 10:05 until 11:05.
2. Columns resizeable (need at least 4 columns)
3. Filter messages based on column content, need to be able to display +/-x number of messages before and after filtered message so that context becomes clear
4. Color coding of log messages based on similar filter criteria as in 3.
What I'm looking for is suggestions of what would be best to extend, how to approach the design, etc. I've started to look into the DataGridView control to see if that might serve my needs, but I'm not terrifically happy with performance so far.
Any suggestions/pointers/opinions appreciated!
--
Umm... what's a .sig? ;]
|
|
|
|
|
should try to writing Log using Named Pipe and Display in Listview Control.
thanks
sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
Unfortunately I don't have to luxury of using Named Pipe - the messages are coming out of another app I have no control over and I have to use a web service. But I agree with you in principle... ;]
I'll look into ListView. Not sure it'll meet all my criteria yet, but thanks for the suggestion!
--
Umm... what's a .sig? ;]
|
|
|
|
|
Is there something called as a titlebar for a user control?
If yes then could I get a link explaning the same?
Thanks in advance.
Keshav Kamat
India
|
|
|
|
|
Why you need titlt bar in a user control
which type of uercontrol are you looking for?
you can create psuedo title bars using picture box or panel
My small attempt...
|
|
|
|