|
|
Hi,
SerialPort.Read documentation contains following note:
"Because the SerialPort class buffers data, and the stream contained in the BaseStream property does not, the two might conflict about how many bytes are available to read. The BytesToRead property can indicate that there are bytes to read, but these bytes might not be accessible to the stream contained in the BaseStream property because they have been buffered to the SerialPort class."
If you want specific help, show all code involved + port settings + actual bytes received.
|
|
|
|
|
I understand the documentation but that does not explain why I never got
the data. It would explain it if I only checked one time.
I ran the release version of .exe and I receive data without any changes to
existing code. However the reception rate is very slow compared to
something like hyperterm. I ran another Serial Terminal program
that I downloaded from an article on CodeProject and it does the same
thing. I think I may need to play with the read timeouts. So far
Im not very impressed with .Net's support for serial ports. [rant] I have
probably done something similiar to this at least 10 times before
on other platforms or development environments including Visual C++
and never had so much trouble. [end of rant]
|
|
|
|
|
Dear Friends,
What i want is that whenever i add new form in my application using Visual studio, it should appear in some different color and contains some different icon than what VS adds in default. Plz tell me how
Imtiaz
|
|
|
|
|
hi
i'm not sure that i got your question but may you can use visual studio templates
then you can add your custom form in 'Add' dialog box instead traditional windows form
I Wish the Life Had CTRL-Z
|
|
|
|
|
How can I copy a file and preserve the creation date?
|
|
|
|
|
i know a trick with MS-Dos command prompt but i think it will not be usefull for you
however if you didn't find your answer try System.IO.Directory.SetCreationTime
as your last solution
I Wish the Life Had CTRL-Z
|
|
|
|
|
Hi,
Explorer when copying a file sets creation time current,
but preserves last modified time (which seems logical).
And I assume File.Copy does the same.
AFAIK there is no function that does it differently.
You could make a method that copies a file and restores some
of the file properties, e.g. by using File.Get/SetCreationTime.
Regards,
|
|
|
|
|
Yeah! I am now using Western Digital drive mirroring but it is not convienent. Did a thirty day agricultral experiment that required date and time of each picture to be recorded. Did not realize that this data would be lost when the images were transfered from the chip to the hard drive. Lost thirty days work.
Guess Ile have to write a piece of software for this.
|
|
|
|
|
Two ideas:
If the file is created and written only once (i.e. not modified afterwards) on a Windows
system, then the "last written" or "modification" date should not change when the file
gets copied by either Win Explorer or File.Copy
If your pictures are JPEG files generated by a camera, it is very likely they contain a lot
of "properties" including the date & time of exposure (assuming the camera's real-time clock
has been initialized correctly...).
|
|
|
|
|
Luc
Thanks the modified date is correct for all the pics. So I will be able to salvage my work. Some how modified does not seem to be good terminology for when a picture is taken but thats MS for ya. I still am going to write a copy utility for my own use. The code below seems to work. Any Suggestions.
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
string infile="";<br />
string outfile = "C:\\test.jpg";<br />
OpenFileDialog dlg = new OpenFileDialog();<br />
if (dlg.ShowDialog() == DialogResult.OK)<br />
{<br />
infile = dlg.FileName;<br />
File.Copy(infile, outfile, true);<br />
File.SetCreationTime(outfile,File.GetCreationTime(infile));<br />
} <br />
}<br />
-- modified at 17:54 Saturday 5th May, 2007
|
|
|
|
|
Hi,
1. file times
creation time is when the file got created
modification time is when the file contents last have been modified
and yes that can be before creation time (when file gets copied, as you have experienced).
2. code comments
I would put infile declaration and all actions inside the OK? test
3. JPEG
as I said before, JPEG files typically contain a lot of properties, which may be the safest way
to retrieve exposure information. If you want to make sure for your files, just mail me one.
Regards
|
|
|
|
|
Hi,
digital cameras add a lot of information into the JPEG files they generate.
This info is loaded into the Image object when executing Image.FromFile(filespec).
The info can be interrogated, item by item, by calling Image.GetPropertyItem(itemID).
AFAIK the info is preserved (not updated) when such image gets operated upon;
So as long as you modify and then save the Image to another file, you will still have
all the original properties, which may have become invalid, since they contain size,
datetime, etc, which may have been modified or become meaningless by the applied modifications.
When you create a new image from an existing one, as in new Bitmap(myImage),
the properties are not copied.
BTW you can add or modify properties using Image.SetPropertyItem().
Regards,
|
|
|
|
|
|
Use:
File.GetCreationTime and store it in a file ( .xml, .txt, .dat...e.t.c )
Hope this helps...
|
|
|
|
|
Read Luc's comments they are insitefull!
|
|
|
|
|
hi..
i have built up a window based software ...with vb.net....i want the software to be installed in any machine....with setup.exe...the datasource is now required to be changed the user from .exe.config file...but how can the software retrieve machine's servername and change the datasource to the machine's servername...
thanks
|
|
|
|
|
System.Environment.MachineName will return the current machine's netbios name.
System.Environment.GetEnvironmentVariable("COMPUTERNAME") will return the computer name
|
|
|
|
|
Hi,
I am new in Communicator Web Access. Can you please provide me some sample using Communicator Web Access?
I tried to connect Communicator Web Access server. My main problem is that how can i get event when any body comes online? I want to develop web application using ASP.Net and C#. Can you please tell me, how browser is refreshed when any body comes online?
Thanks,
Regards,
Hardik Patel
Analyst Programmer
|
|
|
|
|
i want to insert unicode(arabic,urdu) characters from c# to SQL server 2005. but sql is not supporting the unicodes.
|
|
|
|
|
rehab1 wrote: but sql is not supporting the unicodes.
it does.. change datatype to unicode by adding 'n' in front of type name ex. 'nchar', 'nvarchar'..
life is study!!!
|
|
|
|
|
You dont want to be reported as a spammer do you
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I don't know how many times you intend to ask this question, but it might help you to get an answer if you FOLLOWED THE GUIDLINES in "how to get an answer to your question" above. What do you mean when you say "sql is not supporting the unicodes". Are you getting an error when you try to insert/update a field that contains a unicode character? Are you getting incorrect data when you read the data back ? Or ar you looking ad the DISPLAY, and not realizing that the font used can't display that character (for instance, in Management Studio)?
Sql server has supported Unicode for quite some time (NCHAR, NVARCHAR and NTEXT data types), but depending on the version installed, some tools may not display those correctly, substituting typically a 'box' character for those not in the current font. The data is correct, its just that the reading application cant display it using the font it is running with. Not sure what your problem is, since you have discribed it so poorly, but I suspect it is the disply issue, since that commonly trips up newbies (who also tend not to pay attention to posting guidelines).
|
|
|
|
|
use nvarchar(...)
Hope this helps...
|
|
|
|
|
Hi!
Is there a way to check if an event handler for an object has been already assigned in "current" object?!
ex.
<br />
class objOne{<br />
public event EventHandler<EventArgs> someEvent;<br />
}<br />
<br />
class objTwo{<br />
public objOne;<br />
<br />
public event EventHandler<EventArgs> someOtherEvent;<br />
}<br />
<br />
class objThree{<br />
objThree(objTwo someObjectTwo){<br />
someObjectTwo.someOtherEvent+=new EventHandler(someDelegate); <br />
}<br />
<br />
void someDelegate(object sender, EventArgs e){
objTwo.objOne.someEvent+=new EventHandler(someOtherDelegate); <br />
}<br />
}
someDelegate is invoked a few times and evey time it adds someOtherDelegate to the objTwo.objOne.someEvent.. my goal is to add this delegate only once..
the only idea that comes to me is to add a flag field in objOne specially for objThree but that takes away flexibility..
thanks for any help!!
life is study!!!
|
|
|
|