|
Hi all!I have these two lines of codes in my program:
float time = (float)DateTime.Now.Second;
xyGraphControl1.AddPoint(time,power);
The result of the codes is that the timer starts at the same second as the clock in my computer.
How am I going to force the timer to always and only start at 0 second?
Thank you very much!
|
|
|
|
|
What timer?
Please provide some more details (code) about what you're trying to do.
www.troschuetz.de
|
|
|
|
|
Actually this timer is act like a stop watch in my program..So when everytime i press start button it will start run from 0 seconds until i press stop button to stop it.Now the problem is when i press the start button it start according to my computer time(second).
float time =(float)DateTime.Now.Second ;
xyGraphControl1.AddPoint(time, power);
long StartClock;
private void StartButton_Click(objectsender,System.EventArgse)
{
timer1.Start();
// get the exact hour started in milliseconds
StartClock = DateTime.Now.Ticks;
xyGraphControl1.Reset();
}
Thank very much!
|
|
|
|
|
levi`s wrote:
float time =(float)DateTime.Now.Second ;
xyGraphControl1.AddPoint(time, power);
Ok, but what's with these lines of code? What should they do and in which context (method) do they stand?
www.troschuetz.de
|
|
|
|
|
the 1st line mean assign the time(second) in the my computer to float time and the 2nd mean add point to the graph with X-axis is time and Y-axis is power..So basically this AddPoint is add the point to the point to the graph
|
|
|
|
|
I guessed that. But where is that code and what does it has to do with your timer?
www.troschuetz.de
|
|
|
|
|
Guys..
i tryin to sent the follow msg "%01#RCSX0001**" but with a enter key <cr>.
i wanna sent this as a string then get bytes then sent though serial..
but my present program is getting what i type in the text box but now i wanna embedded all the commend in the buttom.. but how to add in the enter key.
i using visual studio c#.. hope to hear from u guys thanks.
|
|
|
|
|
try adding "\x13" into the string, this is the ascii value for enter.
Enjoy
|
|
|
|
|
hi
How rename the file name. (without using function move or moveto) using C# or vb.net
thnx
From
Aijaz Ahmed Niazi
|
|
|
|
|
|
That's what you use! You just move the file to the same directory the file is in, but just supply the new filename.
Dim fi As New FileInfo("C:\dir\dir\test.txt")
fi.MoveTo("C:\dir\dir\newText.txt")
... is one way to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
All,
How can I access the log file of a c# .net web application?
Thanks
|
|
|
|
|
hi there,
u mean that u want to access log files created by web app itself or IIS log or from event log?
<< >>
|
|
|
|
|
I need to access the log files and IIS log
Thanks
|
|
|
|
|
use the code list:
p1.X = 10;
p1.Y = 15;
p2.X = 68;
p2.Y = 100;
path.AddLine(p1, p2);
g = this.panel1.CreateGraphics();
g.DrawPath(Pens.Black, path);
Then,I draw a line on the graphic.In the event of Mouse_Move,I catch any point and want to know whether the point in the path of the line.
So I use the funcation of GraphicsPath.IsVisible(),but whenever the funcation always return false.
Can you help me? Thanks!
|
|
|
|
|
I'm learning C#, and hit this wall while trying to extract attrib info from an XML file. The method I'm using is
void Button4Click(object sender, System.EventArgs e)
{
string fileName = "..\\..\\books.xml";
XmlTextReader tr = new XmlTextReader(fileName);
listBox1.Items.Clear();
int countAttribute = 0;
while(tr.Read())
{
if(tr.NodeType == XmlNodeType.Attribute)
{
countAttribute++;
string displayString = tr.Name;
displayString += tr.Value;
listBox1.Items.Add(displayString);
}
}
tr.Close();
MessageBox.Show("Encountered " + countAttribute + " attribute(s)");
}
The XML file indeed contains attribs, and here's a part of it:
<book genre="humor" publicationdate="1897" ISBN="0-863411-58-1">
<title>Three men in a boat</title>
<author>
<first-name>Jerome</first-name>
<last-name>Jerome</last-name>
</author>
<price>4.99</price>
</book>
However, the list is not getting populated and the message box tells me it encountered no attributes at all. Am I doing something wrong? Can somebody please tell me how to get the attribute names and values?
Thanks in advance!
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
-- modified at 2:41 Monday 19th September, 2005
|
|
|
|
|
Hi Vikram,
You can try this :
string fileName = "..\\..\\books.xml";<br />
XmlDocument xmlDocument = new XmlDocument();<br />
<br />
xmlDocument.Load(fileName);<br />
<br />
foreach (XmlNode xmlNode in xmlDocument.SelectNodes("//@*"))
{<br />
}<br />
Hope that helps,
Bruno
|
|
|
|
|
Hi, Bruno! Thanks for the reply. It works like a charm and I'm able to extract the info I need.
Is there some way to do it using XmlTextReader, since I might want to do something else with the other elements?
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
Hi again,
You can eventually pass an XmlReader to xmlDocument.Load method instead of a filename !
Bruno
|
|
|
|
|
I'm looking for a code to flip a window, like in the Tiger - Apple OS.
I though of the following algorithm but I can get it implemented right:
1. Capture the window who is about to be flipped.
2. Hide it and display the image.
This is the part which I don't know how to implement:
3. Start changing the image size so it looks like its being flipped.
4. Display a new window which is the "back side" of the original
window.
If anyone thinks that there is a better algorithm, or how to implement
the algorithm suggested, please...
Amir Harel
|
|
|
|
|
Hi!!
I want to store some information in text files but it should not be visible in that!!How do i do that?Is there any section or header -footer like exe files,Plz reply!!
|
|
|
|
|
hi there,
akshayswaroop wrote:
Is there any section or header -footer like exe files
=> no structure like this for plain text file
akshayswaroop wrote:
I want to store some information in text files but it should not be visible in that!!How do i do that?
=> yep, u can do that. because u can store what u want into a text file
<< >>
|
|
|
|
|
Can u be more clear,Icould not get u,That info should not be visible in file!!
|
|
|
|
|
As others have stated before: It is not possible.
Besides the whole approach of trying to use text files to store information you want not to be visible seems to be rather braindead.
The whole point of plain text files _is_ that the contents are readable with an arbitrary text editor.
If you want information to be unreadable for your users then use binary files!
mav
|
|
|
|
|
Stor it in a seperate stream. It will only work with NTFS though. If the file is copied to a non-NTFS file systems the extra streams are lost. The data will also be lost if the file is copied using a "homemade" copy function reading the binary stream and writing it to the new file. And no, I can't remember how to open a separate stream, I just know it can be done.
|
|
|
|