Introduction Website speed is one of the most important ranking factors for Google. A slow site results in lower traffic, fewer conversions, and a bad user experience. Here are five simple, beginner-friendly ways to improve your website speed instantly. 1. Optimize Images Large images make your website slow. Tips: Reduce size Use WebP format Compress images 2. Enable Lazy Loading Lazy loading loads images only when a user scrolls to them. This reduces initial load time. 3. Reduce Widgets and Scripts Too many widgets (especially on Blogger) slow down the site. Remove: Unnecessary JavaScript Heavy widgets Popup ads 4. Use a CDN (Cloudflare) Cloudflare caches your website and serves it from nearby servers. This dramatically boosts speed. 5. Test Your Speed Regularly Use: Google PageSpeed Insights GTmetrix Lighthouse Fix any issues they report. Conclusion By optimizing images, using a CDN, and reducing scripts, your website becomes ...
string strRootFolder = "FolderPath";
AddDirectorySecurity(strRootFolder + "\\" + txtFolderName.Text, getAccountName(), getFolderRight(false, true), AccessControlType.Allow);
private FileSystemRights getFolderRight(bool isWrite, bool isRead)
{
try
{
if (isWrite)
return FileSystemRights.Write;
if (isRead)
return FileSystemRights.Read;
}
catch (Exception ex)
{
clsErrorHandling _clsErrorHandling = new clsErrorHandling();
_clsErrorHandling.AddExceptionDetail(ex, "DocumentRepository.aspx");
}
return FileSystemRights.Delete;
}
private string getAccountName()
{
string strAccountName = "";
try
{
strAccountName = @"Dataworld.co.in\Jain.r";
}
catch (Exception ex)
{
clsErrorHandling _clsErrorHandling = new clsErrorHandling();
_clsErrorHandling.AddExceptionDetail(ex, "DocumentRepository.aspx");
}
return strAccountName;
}
// Adds an ACL entry on the specified directory for the specified account.
public static void AddDirectorySecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
try
{
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
// Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
// Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, ControlType));
// Set the new access settings.
dInfo.SetAccessControl(dSecurity);
}
catch (Exception ex)
{
clsErrorHandling _clsErrorHandling = new clsErrorHandling();
_clsErrorHandling.AddExceptionDetail(ex, "DocumentRepository.aspx");
}
}
// Removes an ACL entry on the specified directory for the specified account.
public static void RemoveDirectorySecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
try
{
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
// Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
// Remove the FileSystemAccessRule to the security settings.
dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account, Rights, ControlType));
// Set the new access settings.
dInfo.SetAccessControl(dSecurity);
}
catch (Exception ex)
{
clsErrorHandling _clsErrorHandling = new clsErrorHandling();
_clsErrorHandling.AddExceptionDetail(ex, "DocumentRepository.aspx");
}
}
Comments
Post a Comment