|
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.
|
|
|
|
|
I'm developing a windows application in C# usin .NET framework 3.5. Suppose a user opens one form to work. and after working he need to move next page without saving data
if user click the next page i need to give one message like "You May lose unsaved data"
if ok then contine else cancel to stay on the page i don't know where to write code
|
|
|
|
|
Put it either in the button he uses to click to the next page as a message box or on the form close and if you choose not to close handle there. Google is your friend.
|
|
|
|
|
ashajahanmca wrote: if user click the next page
It depends on what 'next page' is. If it is a Control descendant, write your code in the Click event handler.
Give them options for OK and Cancel, if they choose Cancel, just return from the handler before executing the code for next page.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
<asp:Button ID="Button1" runat="server" Text="Add" OnClientClick=" return Test()" onclick="Button1_Click" />
Place it in head section
<script language="javascript" type="text/javascript">
function Test()
{
return confirm("Are u sure");
}
</script>
himanshu
|
|
|
|
|
The OP said it was a Windows Application, although he was talking about pages, so it could be that your reply might be more useful than the others.
I guess we'll never know, unless the ungrateful so-and-so lets us know!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
when I try to parse HTML source code, if I found Scripts by mshtml.HTMLScriptElement
<script>
window.google={kEI:"_Hw3Su_qGZLWwgP5roioDg",kEXPI:"17259,17291",kHL:"en"};
window.google.sn="webhp";window.google.timers={load:{t:{start:(new Date).getTime()}}};try{window.google.pt=window.gtbExternal&&window.gtbExternal.pageT()||window.external&&window.external.pageT}catch(b){}
window.google.jsrt_kill=1;
var _gjwl=location;function _gjuc(){var b=_gjwl.href.indexOf("#");if(b>=0){var a=_gjwl.href.substring(b+1);if(/(^|&)q=/.test(a)&&a.indexOf("#")==-1&&!/(^|&)cad=h($|&)/.test(a)){_gjwl.replace("/search?"+a.replace(/(^|&)fp=[^&]*/g,"")+"&cad=h");return 1}}return 0}function _gjp(){!(window._gjwl.hash&&window._gjuc())&&setTimeout(_gjp,500)};
window._gjp && _gjp();
</script>
How can I access (if I want to change the scripts) this using c#?
|
|
|
|
|
hi..i am doing a project in c#.net.i want to know how i access web services to my project.my project is news management system,and i want add flash news facility through web services.please help me
|
|
|
|
|
Create a web service or get a external web service and add it to your project through "Add a webreference" option. Or you build your own, deploy it in IIS and add a web reference of that. now you can use it.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|