|
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!!!
|
|
|
|
|
Seishin# wrote: public event EventHandler someEvent;
Instead of simply declaring the delegate, assign null to it.
public event EventHandler someEvent=null;
check for null before adding to the delegate .
Regards,
Arun Kumar.A
|
|
|
|
|
Hey!
Arun.Immanuel wrote:
check for null before adding to the delegate .
i can check for null only in the class in which i declare the event..
i "resolved" the problem by trying -= the delegate form event before i += it..
thanks anyway
life is study!!!
|
|
|
|
|
Seishin# wrote:
objTwo.objOne.someEvent+=new EventHandler(someOtherDelegate);
cant U check like:
if(objTwo.objOne.someEvent==null)
objTwo.objOne.someEvent+=new EventHandler(someOtherDelegate);
This will allows only first assignment.
Seishin# wrote: i "resolved" the problem by trying -= the delegate form event before i += it..
Though this statement will make the delegate invoke only one function,
U R remiving and assigning the function each time.
Or can't u simply assign with "=" sign instead of +=, so that it will
overwrite any existing one.
Regards,
Arun Kumar.A
|
|
|
|
|
Arun.Immanuel wrote: cant U check like:
if(objTwo.objOne.someEvent==null)
objTwo.objOne.someEvent+=new EventHandler(someOtherDelegate);
nope.. as i wrote you can check event for null only in the class where you declare it.. in this case it would by objOne.. in objThree I can only += or -= delegates..
Arun.Immanuel wrote: Though this statement will make the delegate invoke only one function,
U R remiving and assigning the function each time.
yup.. and thus it'll prevent adding more than one instance of my wished delegate from objThree to someEvent.. if i didn't try to -= the delegate another instance of it would be added later and in effect in stead of caling the delegate once i'd do it as many times as i added it..
Arun.Immanuel wrote: Or can't u simply assign with "=" sign instead of +=, so that it will
overwrite any existing one.
putting aside the fact that you cant do something like that, I'm assigning delegates to this event in other classes too so i can't do something like that..
btw. you shouldn't use the U in stead od 'you' etc. on this kind of forums (this kind of writing has its name but can't remember it )
life is study!!!
|
|
|
|
|
Seishin# wrote: btw. you shouldn't use the U in stead od 'you' etc. on this kind of forums (this kind of writing has its name but can't remember it )
Thank you very much.
Regards,
Arun Kumar.A
|
|
|
|
|
Hello every body
when i want to connect to a PC which have a real IP
we use
TcpClient myclient = new TcpClient(ip,port);
what if we want to connect to a pc which using a DSL connection ?
please help
|
|
|
|
|
|
get his ip address
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
so , how to get his real ip
if he uses DSL Connection his ip will be as an example (10.0.0.3)
& this certainly cann't be acessed ,,,
we need the real ip
|
|
|
|
|
The "real IP" is the one visible to the internet. You can't get his private IP on his local network. There's, usually, no direct route for IP packets to go to get to a private IP address. His router has to be setup to allow, and redirect to his machine, the connection request from your machine on the Internet.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|