Click here to Skip to main content
15,897,032 members
Home / Discussions / C#
   

C#

 
GeneralRe: WMI Pin
Luc Pattyn16-Jun-09 4:31
sitebuilderLuc Pattyn16-Jun-09 4:31 
QuestionMicrosoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 3:07
michaelgr116-Jun-09 3:07 
AnswerRe: Microsoft.Office.Interop.Excel problem Pin
stancrm16-Jun-09 3:28
stancrm16-Jun-09 3:28 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 4:36
michaelgr116-Jun-09 4:36 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr116-Jun-09 6:58
michaelgr116-Jun-09 6:58 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
MumbleB16-Jun-09 7:55
MumbleB16-Jun-09 7:55 
GeneralRe: Microsoft.Office.Interop.Excel problem Pin
michaelgr117-Jun-09 6:45
michaelgr117-Jun-09 6:45 
QuestionInstalling fonts on a Vista Pc Pin
Okultist16-Jun-09 1:55
Okultist16-Jun-09 1:55 
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);
                    //AddFontResource(fontPath);
                    //SendMessage(HWND_BROADCAST, WM_FONTCHANGE, (IntPtr)0, (IntPtr)0);

                }
                catch (SecurityException se)
                {
                    MessageBox.Show(se.ToString());
                }
                catch (UnauthorizedAccessException ex)
                {
                    MessageBox.Show(ex.ToString());
                }

            }
<pre>

Thanks for your help

AnswerRe: Installing fonts on a Vista Pc Pin
dan!sh 16-Jun-09 2:24
professional dan!sh 16-Jun-09 2:24 
GeneralRe: Installing fonts on a Vista Pc Pin
Luc Pattyn16-Jun-09 2:54
sitebuilderLuc Pattyn16-Jun-09 2:54 
GeneralRe: Installing fonts on a Vista Pc Pin
dan!sh 16-Jun-09 3:35
professional dan!sh 16-Jun-09 3:35 
GeneralRe: Installing fonts on a Vista Pc Pin
Okultist16-Jun-09 3:43
Okultist16-Jun-09 3:43 
GeneralRe: Installing fonts on a Vista Pc Pin
dan!sh 16-Jun-09 5:25
professional dan!sh 16-Jun-09 5:25 
GeneralRe: Installing fonts on a Vista Pc Pin
Okultist16-Jun-09 3:40
Okultist16-Jun-09 3:40 
AnswerRe: Installing fonts on a Vista Pc Pin
Okultist17-Jun-09 2:46
Okultist17-Jun-09 2:46 
QuestionState Maintenance Pin
ashajahanmca16-Jun-09 1:44
ashajahanmca16-Jun-09 1:44 
AnswerRe: State Maintenance Pin
Michael Bookatz16-Jun-09 1:50
Michael Bookatz16-Jun-09 1:50 
AnswerRe: State Maintenance Pin
Henry Minute16-Jun-09 1:54
Henry Minute16-Jun-09 1:54 
AnswerRe: State Maintenance Pin
himanshu256116-Jun-09 2:01
himanshu256116-Jun-09 2:01 
GeneralRe: State Maintenance Pin
Henry Minute16-Jun-09 4:39
Henry Minute16-Jun-09 4:39 
Questionhow to access javascript using c# Pin
svt gdwl16-Jun-09 1:19
svt gdwl16-Jun-09 1:19 
Questionweb services Pin
harispa16-Jun-09 1:05
harispa16-Jun-09 1:05 
AnswerRe: web services Pin
Baran M16-Jun-09 1:23
Baran M16-Jun-09 1:23 
AnswerRe: web services Pin
Tom Deketelaere16-Jun-09 1:24
professionalTom Deketelaere16-Jun-09 1:24 
QuestionProblem with while loop and text file Pin
kallileo16-Jun-09 0:56
kallileo16-Jun-09 0:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.