I want to add one custom field to Add new category (into WP-admin).The purporse of that field would be for icons (e.g user paste font-awesome icon class and it display icon on front-end).

Thank you.


Question: Embed .Net C# In Web Page?
Answer: I ended up faking a COM object using C# then using JavaScript to call that COM object and was able to interact with the CAPI through the browser that way.

JavaScript:

&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;
var keystore = new ActiveXObject("RBCrypto.KeyStore");

function getCertList()
{
   try {
     keystore.openKeyStore("MY", true, false);
     var size = keystore.getStoreSize();

     var list = document.getElementById('list');
     list.size = size;

     for(var i = 0; i &lt; size; i++)
     {
        var fname = keystore.getFriendlyName(i, true);
        var opt = new Option(fname, fname);
        list.options.add(opt);
     }
   }
   catch(err)
   {
     alert(err.description);
   }
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="getCertList()"&gt;
   &lt;center&gt;
    &lt;h2&gt;KeyStore Test&lt;/h2&gt;
    &lt;hr /&gt;
    &lt;br /&gt;
    &lt;select id="list"&gt;&lt;/select&gt;
   &lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;


C#:

using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

namespace RBCrypto
{
    public interface AXInterface
    {
        void openKeyStore(string storeName, bool currentUser, bool readOnly);
        int getStoreSize();
        string getFriendlyName(int index, bool subjectNameIfEmpty);
    }

    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class KeyStore :AXInterface
    {
        public void openKeyStore(string storeName, bool currentUser, bool readOnly)
        {
            if (keystoreInitialized)
                throw new Exception("Key Store must be closed before re-initialization");

            try
            {
                if (currentUser) //user wants to open store used by the current user
                    certificateStore = new X509Store(storeName, StoreLocation.CurrentUser);
                else             //user wants to open store used by local machine
                    certificateStore = new X509Store(storeName, StoreLocation.LocalMachine);

                if (readOnly)
                    certificateStore.Open(OpenFlags.ReadOnly);
                else
                    certificateStore.Open(OpenFlags.ReadWrite);

                allCertificates = certificateStore.Certificates;

                if (allCertificates == null)
                {
                    certificateStore.Close();
                    throw new NullReferenceException("Certificates could not be gathered");
                }

                keystoreInitialized = true;
            }
            catch (ArgumentException ae)
            {
                throw ae;
            }
            catch (SecurityException se)
            {
                throw se;
            }
            catch (CryptographicException ce)
            {
                throw ce;
            }
            catch (NullReferenceException ne)
            {
                throw ne;
            }
        }

        ....
   }
}


C# AssemblyInfo:

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]


In order for this to work the user has to isntall your .dll on their machine (Make sure you specify to register your .dll as vsdraCOM in your installer) and they have to add your site to their trusted sites.