["..G$ ","","AHMYBMMA/// <summary>MA/// Determine if the path file name is reserved.MA/// </summary>MABReserved filenames in Windows operating systemsBMMauxMconMclock$MnulMprnMMcom1Mcom2Mcom3Mcom4Mcom5Mcom6Mcom7Mcom8Mcom9MMlpt1Mlpt2Mlpt3Mlpt4Mlpt5Mlpt6Mlpt7Mlpt8Mlpt9MMBExamples of reserved filenamesBMMaux.txtMCon.binMNUL.pngMcom2.pngMlpt8.aspxBClass that contains reserved names: C#BMMusing System.IO;BMM/// <summary>M/// Contains logic for detecting reserved file names.M/// </summary>MBstatic class BReservedFileNameToolBM{BMA/// <summary>MA/// Reserved file names in Windows.MA/// </summary>MABstatic string[] _reserved = new string[]MA{MAAYconY,MAAYprnY,MAAYauxY,MAAYnulY,MAAYcom1Y,MAAYcom2Y,MAAYcom3Y,MAAYcom4Y,MAAYcom5Y,MAAYcom6Y,MAAYcom7Y,MAAYcom8Y,MAAYcom9Y,MAAYlpt1Y,MAAYlpt2Y,MAAYlpt3Y,MAAYlpt4Y,MAAYlpt5Y,MAAYlpt6Y,MAAYlpt7Y,MAAYlpt8Y,MAAYlpt9Y,MAAYclock$YMA};BHBpublic static bool BIsReservedFileNameB(string path)MA{MAAstring fileName = Path.GetFileNameWithoutExtension(path);B // Extension doesn't matterMAABfileName = fileName.ToLower();B // Case-insensitiveMAABforeach (string reservedName in _reserved)MAA{MAAAif (reservedName == fileName)MAAA{MAAAAreturn true;MAAA}MAA}MAAreturn false;MA}BHBpublic static bool BIsNotReservedFileNameB(string path)MA{MAAreturn !IsReservedFileName(path);MA}M}B","A'EfA`PF(B|F969669(C/CE","Reserved file names"," cannot be used. We can detect these names in strings in a C# program. This ensures we don't generate an invalid file name. Some reserved file names are CON.txt, PRN.doc and nul.exe. ","Example."," First, this problem can occur when a Windows server tries to serve a file such as PRN.aspx, which is dynamically generated. The file will not be available. I wrote this C# static class to detect such invalid file names. ","Static Class ","static","You can save"," this static class in a file. We call its public static method IsReservedFileName to determine if a path has a reserved file name. In Windows, you are allowed to use the first letters in a reserved name as a file name. ","But: ","There must be further letters. You are not allowed to use the reserved file names.","Summary."," We saw a useful method. It can detect the invalid file names that Windows reserves. This includes Windows XP, Windows Vista, and all the Windows server environments, such as IIS 6.0 and IIS 7.0. ","This code could be sped up with a static Dictionary. But the performance difference isn't important in many cases.","Static Dictionary ","static-dictionary"]

%iVBORw0KG;)NSUhEUg?AP)BDCAM?ACV1Xh7)GFBMVEX::r+vixvbyJk5Lc3NzF9vGv19NhYWHPSHDN?ADzklEQVR4XuXa25KjMAwEUFoX8/9/vElmoEsIORTl3SWkHxnF9ilzsWGmq8QM0/cEMj+i9jVgnX/yLWKZf6NXBcAweIKvPMUmOnhk8xpxXEwrGqZiPPhq4nn+q+Dm7tcFY/hNa/ZHcE0wBg4Nygm+IphDG7zwaH53MIPWmvv9wQx8yXRrMOP/fIJh8ooZhoJfzdrROcahYRreUOzpsHcLCkZVAkCXsIBhbSh+GW1tVzJFtxHsDo2dYB2nSqmlJQzTwk0yJ01snQ2YR6GprNuq7gGEf7NQDApqC0MwZ2Ew2Iq6s+CtBWVxDWbNeLAVfZ4EZ4wW3j7YCoW7AwfB/ggSWHMl3oDZTgZrNgiLe5Z4n1UCVB5RXcHuZ8F1p3gH9gyus6lWSlprugs2DtvXNNEIliVskZHWA4s0oWipi63qETB7DohQSdsrC/nJX9atQu9O0tKATYaUYIU/Ey6U1KjLYbCAkEck1GsaHNv9DXgW+HAwvS5hw3seLCAkX/SBFxpuHTBeGQFm1/F3OAHmhNY/sG0VAB4iOJSBPmADBo?RgjB2QtlLxGMZ/rg7PVGsDs24OakEOe/g9TQHAZsHghuvDIIJok5BlZOk/XBPBq6zVdIm0aChSd7BOMcmN53YPJyt9jc820EOJ9afIKdBiu9EewEB106VDzXxcaCiy3vWTCmAsyOqdM8XO5oGBWMA0/DwPQmcK5EvhowUZwio8AYDJ5qMC9PbQ7C8hNI5hzFeDCWDAdniKoS4wTXu2YdDM4ZD5602ieloXiTbbF8HthKb27YPZk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