Friday, February 16, 2018

Outlook 2016 integration to Skype for business Lync 2016

I got issue on outlook 2016 where Skype for business (Lync 2016) status for contacts not showing.

I have followed below steps and worked

1. Open RegEdit by typing in run command (WinKey + R)
2. Go to Path HKEY_CURRENT_USER\SOFTWARE\IM Providers
3. Update DefaultIMApp value as "Lync" as in screenshot below
4. Restart outlook



Ref: https://blogs.msdn.microsoft.com/rathomas/2012/12/03/outlook-2013-users-are-unable-to-see-the-presence-info-in-outlook/ 

Thursday, December 14, 2017

C# - How to merge paths with slashes in all subsequent params

To combine file paths with slashes will take care by below code

public static string MergePath(params string[] stringPaths)
        {

            for (int i = 0; i < stringPaths.Length; i++)
            {
                //To skip trim on first path
                if (i != 0)
                    stringPaths[i] = stringPaths[i].Trim().TrimStart(Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar);
            }

            return Path.Combine(stringPaths);

        }



Example:
var stringtest = Extensions.MergePath(@"c:\path\", @"\dir\file.txt");
var stringtest2 = Extensions.MergePath(@"c:\path\",@"\test\adsf\", @"\dir\file.txt");
var stringtest3 = Extensions.MergePath(@"c:\path", @"test\adsf", @"dir\file.txt");

Output:
"c:\\path\\dir\\file.txt"
"c:\\path\\test\\adsf\\dir\\file.txt"
"c:\\path\\test\\adsf\\dir\\file.txt"