26-10-12, 10:30 PM
نحمده ونصلي على رسوله الكريم
في حدث إغلاق النموذج form closing اكتب:
في حدث تحميل النموذج form load اكتب:
في حدث إغلاق النموذج form closing اكتب:
كود :
[align=left]try
System.IO.File.Copy(Application.ExecutablePath, System.IO.Path.GetTempPath() & "tempapp.exe", true)
System.IO.File.WriteAllText(System.IO.Path.GetTempPath() & "temppath.txt", Application.ExecutablePath)
System.Diagnostics.Process.Start(System.IO.Path.GetTempPath() & "tempapp.exe")
catch
end try
[/align]كود :
[align=left]if Application.StartupPath & "\" = System.IO.Path.GetTempPath() then
try
System.IO.File.Delete(System.IO.File.ReadAllText(Application.StartupPath & "\tempapp.txt"))
catch
end try
me.Close()
exit sub
end if
[/align]