Monday, March 7, 2022

SocketException: An attempt was made to access a socket in a way forbidden by its access permissions.

I restarted this service: Host Network Service on windows Services program. And it worked. Open windows terminal as Admin and run the following commands one by one.

 Step 1  
 ----------------------  
 net stop hns  

 Step 2  
 ----------------------  
 net start hns  

Sunday, October 28, 2018

Search Inside a SQL Procedure

 SELECT DISTINCT  
     o.name AS Object_Name,  
     o.type_desc  
  FROM sys.sql_modules m  
     INNER JOIN  
     sys.objects o  
      ON m.object_id = o.object_id  
  WHERE m.definition Like '%YourText%'   

Tuesday, June 19, 2018

Access IIS Localhost From Another Computer


  1. Open cmd as an administrator.
  2. Allow the ports to be accessed by the firewall.
  3.  >netsh advfirewall firewall add rule name="Open Port 3000" dir=in action=allow protocol=TCP localport=3000  
    
    Here we are assuming that my project is on port 3000.
  4. Allow IIS to use your IP and machine hostnames. You can choose to use both or just one.
  5.   > netsh http add urlacl url=http://pc-hostname:3000/ user=everyone  
      > netsh http add urlacl url=http://10.0.1.10:3000/ user=everyone  
    
    Here we are assuming the IP address of my machine is 10.0.1.10
  6. Add the hostnames to your local IIS configuration.
    1. Navigate to "Documents\IISExpress\config"
    2. Open "applicationhost.config"
    3. Locate the applications you need to enable remote access for. In the case of my "RemoteAccess" project, you're looking for this:
    4.  <site name="RemoteAccess.web" id="17">  
        <application path="/" applicationPool="Clr4IntegratedAppPool">  
          <virtualDirectory path="/" physicalPath="C:\Users\Justin Walker\Documents\Visual Studio 2013\Projects\Remote Access\RemoteAccess.Web" />  
        </application>  
        <bindings>  
          <binding protocol="http" bindingInformation="*:3000:localhost" />  
        </bindings>  
       </site>  
      
    5. Add "binding" directives under "bindings." My changed configs look like this.
    6.  <site name="RemoteAccess.web" id="17">  
        <application path="/" applicationPool="Clr4IntegratedAppPool">  
          <virtualDirectory path="/" physicalPath="C:\Users\Justin Walker\Documents\Visual Studio 2013\Projects\Remote Access\RemoteAccess.Web" />  
        </application>  
        <bindings>  
          <binding protocol="http" bindingInformation="*:3000:localhost" />  
          <binding protocol="http" bindingInformation="*:3000:pc-hostname" />  
          <binding protocol="http" bindingInformation="*:3000:10.0.1.10" />  
        </bindings>  
       </site> 


Wednesday, April 11, 2018

Uncaught typeerror: cannot read property 'msie' of undefined | Solution

Solution 1


 Downloaded jquery-migrate.1.2.1.js and referenced that file in the error page  

Solution 2

Copy the code below to the page

 <script>  
 jQuery.browser = {};  
 (function () {  
 jQuery.browser.msie = false;  
 jQuery.browser.version = 0;  
 if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {  
 jQuery.browser.msie = true;  
 jQuery.browser.version = RegExp.$1;  
 }  
 })();  
 </script>