|
That's a very ambiguous question. Are you having difficulty reading the 2 sets of data in the single XML file? That question can only be answered if one is to understand the schema of the XML file. You'd basically have to read certain parts of the xml file and store them seperately.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
I only have preliminary data within the XML file. How do I read only certain parts of the XML file? How do I indicate the different parts and how do I get C# to to recognize that? Thanks for your help.
Dizzle
|
|
|
|
|
I have this:
System.Data.DataSet ds=new DataSet();
ds.ReadXml("Preconditions.xml");
for(int i = 0; i < ds.Tables.Count - 1; i++)
{
this.comboBox1.Items.Add(ds.Tables[i].TableName);
}
HOwever, it only populates the combobox with tag names. How can I differentiate between the data within the XML file?
DIZZLE
|
|
|
|
|
Rather than reading the XML into a DataSet, why not just read it yourself using System.Xml.XmlReader? You can iterate through whatever pieces of the document you'd like, thus giving you full control over the data.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi
I have a requirement in Curves and angels. I have drawn a line and I will draw a line which is 45 degrees downwrds from the first line and now I would like to draw an arc which meets the 2 points of the second line and the user can change the angle of the second line. From that arc he has to draw one more line of some length (user specifcation) and draws one more line which has an arc bulging outside this arc again is based on the angle specified by the user.
Plz if any one who know the solution help.
Advance Thanks to all.
Regards
Suresh
|
|
|
|
|
Look into the System.Drawing.Graphics class, there are many methods there that should help you. Addition APIs are available in the System.Drawing.Drawing2d namespace.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hi,
I did not get what I was expected plz do help if any one have the solution.
|
|
|
|
|
I have designed a login control that requires a component msrdp.ocx to use a remote server.
this gives my customers trouble because when security settings are on
medium/high it gives a small bar at the top of their screen which they
never see.
So I thought to develop a control in visualc# with a button to load this com clientside which is loaded and hidden.
On page load I want to check clientside if this object already exists
or is running on their server.
If it is login control.visible = true while the load control is hidden.
If it isnt present show load control which on button click should
upload or should i say download to client server this component.
Or better still if I can just load/instanciate it anyways onto the client server on pageload.
I've been at it for weeks and fear i may get the sack if i cant carry
this task out pls help if you have the time.
any assistance would be highly appreciated!
If this dosn't make sense pls visit www.webex.com and join a live demo!
from this you may get the idea!
Kind Regards
Femi Ojemuyiwa BSc.
|
|
|
|
|
I am trying to copy a metafile into a Word document, and then set its location on the page. It pastes it alright, but I get an error that the "object is not valid" when I try to change the location. I think I am not properly getting ahold of the shape that has been pasted, but I do not know where the problem is. Here is the code:
object oEnd = "\\endofdoc";
oRange = oDoc.Bookmarks.Item(ref oEnd).Range;
object pasteDataType = Word.WdPasteDataType.wdPasteMetafilePicture;
oRange.PasteSpecial(ref oMissing,ref oFalse,ref oMissing, ref oFalse,
ref pasteDataType, ref oMissing, ref oMissing);
oRange = oWord.Selection.Range;
oShapeRange = oRange.ShapeRange;
oShapeRange.Left = xLoc;
oShapeRange.Top = yLoc;
oShapeRange.Width = xSize;
oShapeRange.Height = ySize;
|
|
|
|
|
I'm trying to validate a TextBox for a floating point or int value ONLY.
Keep getting a compiler error of "Unrecognized Escape Seq".
Regex theRegex = new Regex("[-+]?([0-9]*\.)?[0-9]+ ");
A) A quicker better way to validate?
B) Where is the code incorrect?
thanks
|
|
|
|
|
The '\' right after the * character is what is causing the compiler to baulk. Either escape it ('\\') or make the string verbatim by prefixing the @ symbol (Regex theRegex = new Regex(@"[-+]?([0-9]*\.)?[0-9]+ "); )
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
A.
Specify the RegexOptions.Compiled flag when you create the object if you plan to use it more than once. It takes longer to create the object, but it runs faster.
B.
As regular expressions and C# strings use the same escape character, you have to escape the escape character. Use \\ to put \ in the string.
Also, you are missing the ^ and @ to specify the beginning and end of the string. Without them, any string containing a number will be valid, for an example the string "We have 200 horses.".
You have an extra space at the end of the pattern. Remove that.
[0-9] can also be written as \d.
Regex theRegex = new Regex("^[-+]?(\\d*\\.)?\\d+@");
Or you can use an @-quoted string:
Regex theRegex = new Regex(@"^[-+]?(\d*\.)?\d+@");
---
b { font-weight: normal; }
|
|
|
|
|
The problem is the "\." - characters after the backslash are interpreted Escape Sequence, which in your case makes (luckily) no sense.
Two ways to fix it:
<br />
Regex theRegex = new Regex("[-+]?([0-9]*\\.)?[0-9]+ ");<br />
Regex theRegex = new Regex(@"[-+]?([0-9]*\.)?[0-9]+ ");<br />
----------------------
~hamster1
|
|
|
|
|
Hi,
I have a requirement I am loading the image in an image object and I would like to rotate the image using mouse pointer just like images can be rotated in powerpoint.
If any one is aware of the code plz do help.
Regards
Suresh
|
|
|
|
|
|
Hi,
I did not get the screen shot provided by u and I think it is not suiting my requirement.
Plz help me ina any other way
|
|
|
|
|
as the above response told you use matrix class somthing like
Matrix mx=new Matrix();
mx.Rotate(angle);
Image img=Image.FromFile(imagePath);
Graphics g=pictureBox1.CreateGraphics();
g.Transform=mx;
g.DrawImage(img,rect);
img.Dispose();
g.Dispose();
MCAD
|
|
|
|
|
Thanks for the help but my requirement is when I use the mouse buttton click then I would like it to rotate just like we can rotate an object in powerpoint.
Plz do hlep me in this area.
Advance Thanks
|
|
|
|
|
So can someone help me out here. This is the code that is confusing me the most
<br />
public void SaveAsXML(Stream s)<br />
{<br />
XmlSerializer sr = new XmlSerializer(this.GetType());<br />
sr.Serialize(s, this);<br />
}<br />
In my class I call this function like this:
<br />
commMain.ComSettings.SaveAsXML(saveFileDialog.OpenFile());<br />
Can someone please explain this in newbie terms. It works, but I'm not sure I understand how. And I may want to change this function so that it does not open saveFileDialog everytime, I may want to pass the name of the settings file instead.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
The SaveFileDialog.OpenFile method opens the file and return a stream that is associated with it. You can use any method you want to create a stream for the SaveAsXML call.
For an example, if you create a memory stream, the data from SaveAsXML will go into a buffer in memory, and you can then get the serialized data as a byte array.
---
b { font-weight: normal; }
|
|
|
|
|
XML Serialization is a technique that allows to save your object's state in an XML file and read it back.
saveDialog.OpenFile() returns a Stream, most probably a FileStream , which is passed to the SaveAsXML function. That function then serializes the current instance (this, which is commMain.ComSettings) on which it was called to the stream passed to it.
The effect of running this code is that the commMain.ComSettings instance would have gotten serialized to the stream returned by OpenFile.
Tom Wright wrote:
And I may want to change this function so that it does not open saveFileDialog everytime, I may want to pass the name of the settings file instead.
Create a System.IO.FileStream yourself and pass it to SaveAsXML, like this
using (FileStream fs = new FileStream(filePath, ...)
{
SaveAsXML(fs);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Not sure if this goes here but I didnt want to post it in the lounge either.
So here is the question.
If I take a file and start reading through it as I look at each bit could I flip that bit?
So if it is a 0 make it 1 ... ect?
Here is what I want to do.
Pass 1) Read through a file and reverse all the bits in the file
Pass 2) Take the file and turn all bits off
Pass 3) turn all bits on
Pass 4) Delete the file
Do you think this could allow me to securly delete a file from my system making it unrecoverable?
Thanks
Will
|
|
|
|
|
Not if someone is willing to dismantle the drive and use lab equipment to read residuals directely off the platter. The writehead only erases ~95% of the bit and it's movement over the platter afffects which part is missed so N passes won't erase 100*(1-.05^N) percent of the data. I've got a tool called BCWipe that uses a 35 pass algo designed by someone with initmate knowledge of how the HD writehead works that should render it unrecoverable. If you want to write your own program the used bit patterns are user view/editable. It also has an older 7pass DoD routine.
|
|
|
|
|
OMalleyW wrote:
Do you think this could allow me to securly delete a file from my system making it unrecoverable?
Definately not! After having visited the inside a computer forensics lab, I was surprised astonished at what you have to go through to stop these guys from getting at that data. What're suggesting on doing, really, is very weak.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the reply's
even if they could get to the file, the data is not recoverable...
i guess that is really what I care about is the ability to get rid of data i dont really care if they can recover the file as long as the data is gone...
any thoughts?
will
|
|
|
|