|
Hi,
You should never call the GC.Collect explicitly... Just let the Framework handle it
Do Dispose() your IDisposable objects when possible and clear all unneeded references to make the collection quicker...
Cheers
Damian
|
|
|
|
|
Hi Damian,
Thanks for the suggestions.
Regards,
JJ
|
|
|
|
|
hi to all,
i am working with c# win application.
i want to copy a file from a server on the local machine.
the path to my file is "http://server/Dir1/myfile.doc".
before doing the copy, i need to verify if the file on the server has recent date than the file on the local machine. if yes i want to make the copy and if not i do nothing
any suggestions or code sample
best regards and thanks in advance
fady
|
|
|
|
|
If you convert each segment of the date into a string, and check each segment in order, so:
if (server.year > local.year)
if (server.month > local.month)
if (server.day > local.day)
etc
- I am not sure on the datetime conversion functions, but there will be a way to split it up into segments with normal string functions and then convert them to int32's
Regards
James
|
|
|
|
|
Hey howzit,
I got a project off the net and I am trying to compile it. It gives me this error message:
"Visual Studio cannot start debugging because the debug target 'C:\.....\bin\Debug\xxx.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly."
So I built it first and then ran it. Can someone explain why one has to built and then run some apps and others work when you press run right away?
|
|
|
|
|
can i ask a favor about our project proposal in the internet connection.We
need to make a code in c# editor or in c programming that will ask a user
to input his/her name and a password, then when the user already consumed
1 hour, her/his connection in the internet will be blocked.
So, please help me in this project....... thank you!!! i wait for you're
reply.....please send me a code at shazzney@message.com
-- modified at 3:05 Wednesday 25th January, 2006
|
|
|
|
|
There can be two ways for this
1: Client Server, if u want someone to administor the system u can create a server application that will be on the admins machine and the client on other machines which the users will use.
2: A simple application can also do this,
just start a thread when the user logs in and break the thread
when the time reaches 1 hr and then u can block keyboard and the mouse so that the user cannot access anything or u can lock the computer with the admin rights so the user cannot access anything.
Hope this idea works for u
Regards,
Pramod
|
|
|
|
|
thanks for sharing your idea but all i need is the code in c# editor/C/C++ language coz i dont know it...............
hope you will reply
|
|
|
|
|
So you dont' want to write the program? You only want someone else to do the job for you, for free? Then you lack some understanding of how the world works.
This is a forum for programmers. If you have problems with programming there are a lot of people here that are happy to help you.
If you want someone else to do a job for you, put up a proper proposal for it, including a specification and what you are willing to pay for it.
---
b { font-weight: normal; }
|
|
|
|
|
a basic version would be:
string Password;
string Username;
///WHEN THE USER PRESSES OK///
{
if (tbUsername.Text == Username && tbPassword.Text == Password)
{
this.Close() //close the password entry form
form1.Enabled = true; //assuming the main form is form1
}
else label1.Text = "Username / Password Combination does not match";
}
you cannot really copy and paste this, but thats just lazy anyway
It should give you an idea of the structure you need to use for your program
Regards
James
|
|
|
|
|
hi
i lock a file.. and i acces this how i can unlock this file
in c#..
plz send me any article, code, help for that problem..
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
What do you mean by locking the file?
If you mean that you lock it as you open it, simply close it.
---
b { font-weight: normal; }
|
|
|
|
|
When I get the image from the file the file remains locked
hi,
Can you help?
When I get the image from the file the file remains locked so the Delete
fails with a "used by another process"
how can i unlock this file...................?
its urgent plz help
and if any code and article
send me on
nicevirendra@rediffmail.com
thanx
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
As I see the file stream remains open .
You may copy the image into MemoryStream, then close FileStream .After this you will be able to delete the file and play with the image as you want.
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Actually prob is that:
i save an image...
but when im update image... i want to delete old image frm my IMAGE folder...
i use..
Image = Image.FromFile(imageFileName)
: and thow the error :
this is used by another procees
help me out .....
thanx
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
This code snippet reads image file, show it in PictureBox then delete image file from the disk.
<br />
try<br />
{<br />
MemoryStream ms = null;<br />
FileInfo fi = new FileInfo(textBoxFilePathName.Text);<br />
byte [] buffer = new byte[fi.Length];<br />
<br />
using( FileStream stream = File.Open(fi.FullName, FileMode.Open) )<br />
{<br />
stream.Read( buffer, 0, (int)fi.Length );<br />
ms = new MemoryStream(buffer);<br />
}<br />
<br />
Image img = Image.FromStream(ms);<br />
pictureBox1.Image = img;<br />
<br />
File.Delete( textBoxFilePathName.Text );<br />
<br />
ms.Close();<br />
}<br />
catch (Exception e1)<br />
{<br />
MessageBox.Show( e1.Message );<br />
}<br />
<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
If you load an image from a file, the file remains locked until you call Dispose on the image object.
---
b { font-weight: normal; }
|
|
|
|
|
Hey, howzit, anyone know a good place to get good FREE C# eBooks?
|
|
|
|
|
|
imsathy wrote: gimme ur mail id
If it is a valid free eBook then you can link a URL to it. We don't condone the distribution of copyrighted material. Someone had to write that book and its sales put food on that author's table and a roof over their head. The bottom line is that distributing copyrighted material without the creators consent is theft.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
saravanan_article@yahoo.com
|
|
|
|
|
I dont know of e-books as such, but there are many good reference sites such as Coding4Fun at http://msdn.com/coding4fun - it contains tutorials to make sample applications ranging from a LCD driver to a GPS-Wired application.
|
|
|
|
|
|
|
can somebody give a simple login validation program, i'm a newbie and i just need it for a refernece.thank you!
|
|
|
|