How to programmatically derive Windows Downloads folder “%USERPROFILE%/Downloads”?

Yes it is special, discovering the name of this folder didn’t become possible until Vista. .NET still needs to support prior operating systems. You can pinvoke SHGetKnownFolderPath() to bypass this limitation, like this: using System.Runtime.InteropServices; … public static string GetDownloadsPath() { if (Environment.OSVersion.Version.Major < 6) throw new NotSupportedException(); IntPtr pathPtr = IntPtr.Zero; try { SHGetKnownFolderPath(ref … Read more

‘csc’ is not recognized as an internal or external command, operable program or batch file [duplicate]

Locate the path of csc.exe and add it your PATH environment variable. In my case, the path for 64-bit C# compiler is C:\Windows\Microsoft.NET\Framework64\v4.0.30319. Similarly, you can look for 32-bit C# compiler in C:\Windows\Microsoft.NET\Framework under different .NET framework version directories There will be csc.exe for all versions like v2.0.XXXXX and v3.5. Select the one with the … Read more

What directories do the different Application SpecialFolders point to in WindowsXP and Windows Vista

There’s no single answer to that. In fact, that’s precisely why these “SpecialFolder”s are defined. You use those instead of a hardcoded path. Environment.SpecialFolder.ApplicationData is the most common one. This folder holds per-user, non-temporary application-specific data, other than user documents. A common example would be a settings or configuration file. Environment.SpecialFolder.CommonApplicationData is similar, but shared … Read more

How to set environment variables on Heroku for Node app and connect to the PostgreSQL database?

According to documentation you could use heroku CLI heroku config:set DATABASE_URI=database_uri_here –app your-app-name heroku config:set SESSION_SECRET=session_secret –app your-app-name or you could use UI https://dashboard-classic.heroku.com/apps/{your-app-name}/settings and provide the same variables via web interface, as I mentioned in the above comment NODE_ENV=production is not treated specially by heroku, so you do need to provide it as well … Read more

Values for os.family in Maven profile activation condition

A very useful Maven command for checking these OS properties on your machine: mvn enforcer:display-info Example output on a SunOS / Sparc host: [INFO] Maven Version: 3.0.4 [INFO] JDK Version: 1.6.0_34 normalized as: 1.6.0-34 [INFO] OS Info: Arch: sparc Family: unix Name: sunos Version: 5.8 Example output on a Linux host: [INFO] Maven Version: 3.0.4 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)