|
hey thanks..... it did make some sense.... the problem is am new to asp.net c# programming..... so new dat i just heard datsome thing called CODEDOm existed 4 days ago...some how dealt with it n now am sorta programmin in it... n yestday i was asked to work on appdomain... n im kinda lost... so it would be very very helpful if u could elaborate ..... thnx a lot ...inadvance...
|
|
|
|
|
Is there a WMI namespace, class and properties to get the time on a machine?
Thanks
|
|
|
|
|
Look at this[^].
Did you try even once to find the answer yourself?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
Try Win32_LocalTime, or Win32_UTCTime and Win32_TimeZone.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
|
System.TimeZone for the current time zone.
DateTime.Now for the current time.
Anything else?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Nagy Vilmos wrote: Anything else?
for remote queries WMI may work better.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
woteva
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
akármi?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
igen.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
rendben!
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
hello,
I use Microsoft.Office.Interop.Excel to creat excell file-I create it and in the end of the work with it i close it using
Microsoft.Office.Interop.Excel.Application ExcelApp
But the problem is that even after i close the application the excell still appears in the task manager(in processes).
How can i kill it in the program (when i finish working with excell)?
|
|
|
|
|
I did it this way :
ApplicationClass app = new ApplicationClass();
Workbook workBook = app.Workbooks.Open(filename, 0, true, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
...
app.Workbooks.Close();
app.Quit();
Marshal.FinalReleaseComObject(app);
|
|
|
|
|
It doesn't help.
I still have the process of EXCELL running (in task manager)
|
|
|
|
|
Does anyone know what the problem may be?
|
|
|
|
|
Have you tried to release the Workbook, Worksheets, Ranges etc? The below works for me. I finally force the Garbadge collector to collect.
System.Runtime.InteropServices.Marshal.ReleaseComObject(objRange);
System.Runtime.InteropServices.Marshal.ReleaseComObject(objSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(objBook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(objExcel);
GC.Collect();
These work fine for me.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
I don't have excell range object
i only do objsheet.getrange.... or something like that
so i did the ReleaseComObject only to the application (objexcel), the sheet and the book.
Anyway,
The program still doesn't release the Excell process and i have it in task manager. What can be the problem?
|
|
|
|
|
I want to copy a font file to the fonts directory on windows vista, but currently i fail to get the right permissions.
Everytime I try to copy the font from its current folder to the font-directory (c:\windows\fonts) I get an "UnauthorisedAccessException"
My code looks like this at the moment:
if (System.IO.File.Exists(fontPath))
{
FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, "C:\\Windows\\Fonts\\");
f2.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, fontPath);
if (SecurityManager.IsGranted(f2) == true)
MessageBox.Show("Its fine!!");
else
MessageBox.Show("No Permissions");
try
{
f2.Demand();
MessageBox.Show(fontPath);
System.IO.File.Copy(fontPath, destination);
}
catch (SecurityException se)
{
MessageBox.Show(se.ToString());
}
catch (UnauthorizedAccessException ex)
{
MessageBox.Show(ex.ToString());
}
}
<pre>
Thanks for your help
|
|
|
|
|
Do you have rights to access the Fonts folder?
Which line throws the exception? That would help knowing where the problem is.
जय हिंद
|
|
|
|
|
Hi,
when I run code like that on Vista I am getting a DirectoryNotFoundException on C:\Windows\Fonts\ in the File.Copy() statement, although the folder is visible both in Windows Explorer and in Command Prompt, and I am running with admin privileges.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Same code works for me in XP. I have the variables set as:
string fontPath = @"c:\test.txt";
string destination = @"C:\Windows\Fonts\test.txt";
जय हिंद
|
|
|
|
|
Yeah, the problem is that i am using vista and a few things changed there. There are new security rules and i tried to do it the "good" way by asking the system for permissions.
|
|
|
|
|
Well, in my case the code works perfect in Vista as well (running as Admin). In your case, I see that you are checking the permissions for the file and not the destination folder. You can check the rights for that directory using DirectorySecurity class (I have never used it, hence not sure).
जय हिंद
|
|
|
|
|
Is there a fast way to have a look on the privileges an user has for a folder? the windows explorer should have a way look them up.
|
|
|
|
|
I think its not possible to copy the Font file to the font-folder with out adminstrator status. so i decided to use an application manifest to run my program as a adminstrator on startup.
|
|
|
|