2018-12-10

Hide IISExpress/Run IIS Express at Background

create vbs file as :
-----
Dim App,Site 
Site = "BlogMVC"
If Len(Site) < 1 Then
    Site = WScript.Arguments(0)
End If
App = """%PROGRAMFILES%\IIS Express\iisexpress""" & _
          " /site:" & Site
If Len(Site) > 0 Then
    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run App, 0
    Set WshShell = Nothing
End If
------



AND RUN!

2018-07-27

Call Divert Setting

It is available in settings menu of different phone morever you can call on a number provided by service provider to divert calls.

Anyways you can try below numbers as per requirements.

Call diversion when busy:

**67*number#

Divert to the given number

#67#

deactivate call diversion

##67#

Erase call diversion

*#67#

Request status for call diversion

Call diversion in case the handset is turned off or has not coverage:

**62*number#

Divert to the given number

#62#

deactivate call diversion

##62#

Erase call diversion

*#62#

Request status for call diversion

Call diversion for not responding

**61*number**x#

Divert to the given number aber x seconds (x=5,10,15,20,25,30)

#61#

Deactivate call diversion

##61#

Erase call diversion

*#61#

Request status of call diversion

Call diversion for all conditions above:

*#004*number#

Divert to the given number

#004#

Deactivate call diversion

##004#

Erase call diversion

*#004#

Request status for call diversion

Always divert:

*#21*number#

Always divert to given number

#21#

Deactivate call diversion

##21#

Erase call diversion

*#21#

Request status for call diversion

Erase all call diversions:

##002#[dial]

Remove all call diversions


2018-04-24

Getting Current Controller/Action in MVC

Getting Current Controller/Action in MVC



@{
    var controller = ViewContext.RouteData.GetRequiredString("controller");
    var action = ViewContext.RouteData.GetRequiredString("action");
}




https://stackoverflow.com/questions/6398189/getting-current-controller-action-from-within-partial-view

Click Once, Sort by Name, Click Twice Sort by Desc in MVC

Click Once, Sort by Name, Click Twice Sort by Desc in MVC



    ViewBag.NameSortParm = sortOrder == "name" ? "name_desc" : "name";
    // Rest of your sortOrder param goes here...

    var persons = from s in db.PRT_FEE_PRICES
                  select s;
    switch (sortOrder)
    {
        case "name":
            persons = persons.OrderBy(s => s.NAME);
            break;
        case "name_desc":
            persons = persons.OrderByDescending(s => s.NAME);
            break;
        // ...
    }


2018-04-22

Question: How to pass dot parameter to id in MVC

Question: How to pass dot parameter to id in MVC

Solution:
Add following in Web.config

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>
  
 
 

https://stackoverflow.com/questions/32392776/can-i-pass-dot-as-parameter-to-id-in-controller-method-in-mvc


2018-02-05

How to binding IP Address in LAN of IISExpress


1. Locate file "applicationhost.config" in <Document>/IISExpress/config

2. Scroll down to the code of :





  
        
             
        
        
             
        

3. Adding your binding IP Address as follows:


  




3. Run CMD in admin of following


netsh http add urlacl url=http://192.168.1.1:8080/ user=everyone  






3. Run IISExpress, you are good to go!


2017-08-14

Convert Txt to Image

https://forums.asp.net/t/1832136.aspx?how+to+convert+text+to+image+in+c+


        public static void LoopingFolders()
        {
            Console.WriteLine("Please enter target Folder Path?");
            string basePath = Console.ReadLine();
         
            DirectoryInfo di = new DirectoryInfo(basePath);
            foreach (var dir in di.GetDirectories())
            {
                foreach(var file in dir.GetFiles("*.txt"))
                {
                    string content = File.ReadAllText(file.FullName);
                    string name = file.FullName;
                    SaveTxtAsImage(content, name);
                }
            }
        }
        public static void SaveTxtAsImage(string content, string targetFileName)
        {

       

       
            Bitmap bitmap = new Bitmap(1, 1);
            Font font = new Font("Arial", 30, FontStyle.Bold, GraphicsUnit.Pixel);
            Graphics graphics = Graphics.FromImage(bitmap);
            int width =600;
            int height = 800;

            bitmap = new Bitmap(bitmap, new Size(width, height));
            graphics = Graphics.FromImage(bitmap);
            graphics.Clear(Color.LightYellow);
            graphics.SmoothingMode = SmoothingMode.AntiAlias;
            graphics.TextRenderingHint = TextRenderingHint.AntiAlias;

            graphics.DrawString(content, font, new SolidBrush(Color.FromArgb(255, 0, 0)), 0, 20);
       
            graphics.Flush();
            graphics.Dispose();

            string fileName = targetFileName + ".jpg";
            bitmap.Save( fileName, ImageFormat.Jpeg);


        }

Setup VNC on Ubuntu 20.04

  sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...