How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*.js.map": true, "**/*.js": {"when": "$(basename).ts"}     } }

read, write and save values in app.config file

public void ChangeConfigValue()
        {
            string filename = System.AppDomain.CurrentDomain.BaseDirectory + @"web.config";
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.Load(filename);
            XmlNodeList nodeList = xmldoc.DocumentElement.ChildNodes;

            foreach (XmlElement element in nodeList)
            {
                if (element.Name.ToLower() == "appsettings")
                {
                    XmlNodeList node = element.ChildNodes;
                    if (node.Count > 0)
                    {
                        foreach (XmlElement el in node)
                        {
                            if (el.Attributes["key"].InnerText == "ConnectionString")
                            {                           
                                el.Attributes["value"].InnerText = "321";//write the value
                                string s= el.Attributes["value"].InnerText;//read the value
                                break;
                            }
                        }
                    }
                    break;
                }
            }
            xmldoc.Save(filename);
        }

Comments

Popular posts from this blog

How to get cell value of gridview using JQUERY

how to convert web page to pdf

Export Html to Pdf using iTextSharp(GridView)