Wickasitha's tech Blog

blogging everything

Archive for the ‘Tips & Tricks’ Category

Microsoft reserves 20% of your available bandwidth for their own purposes like Windows Updates and interrogating your PC etc

How to get it back:

Click Start then Run and type gpedit.msc.This opens the group policy editor. Then go to:
Local Computer Policy
then Computer Configuration
then Administrative Templates then Network then QOS Packet Scheduler and then to Limit Reservable Bandwidth.

Double click on Limit Reservable bandwidth. It will say it is not configured, but the truth is under the Explain tab i.e.”By default, the Packet Scheduler limits the system to 20 percent of the bandwidth of a connection, but you can use this setting to override the default.”
So the trick is to ENABLE reservable bandwidth, then set it to ZERO (0). This will allow the system to reserve nothing, rather than the default 20%.

I was getting the follwing error when I try to switch to Design Mode on my page:this is related to web part manager
The specified display mode is currently disabled on this page. Make sure personalization is enabled for the current user
I have the following code that creates the user if they are not in the system and authenticates them as well:
//Authenticate the user in the ASPNETDB personalization DB
if (Membership.GetUser(SiteData.UserInformation.Instance.WebLogin)==null)
{
//Create the user
MembershipUser newUser = Membership.CreateUser(
       SiteData.UserInformation.Instance.WebLogin,
           SiteData.UserInformation.Instance.Password);
Membership.ValidateUser(SiteData.UserInformation.Instance.WebLogin,
SiteData.UserInformation.Instance.Password);
}


Solution :
Just performed 2 steps to use custom authentication.
1. Modify web.config for using Forms authentication mode as “Forms”
<authentication mode=”Forms” >
2. Once you identify a user as valid (may be by checking from database or any other means), execute following line of code.
FormsAuthentication.SetAuthCookie(“<string:username>”, <bool:persistenceCookie>);
e.g. FormsAuthentication.SetAuthCookie(“John_Smith”, false);
The above code automatically updates Webparts for specified username.

iCare Format Recovery v1.0

Worth $69.95 – Time Limited Offer -Free until April 22, 2010

Dedicated in file recovery when drive has been formatted, encountered not formatted error, iCare Format Recovery is the very right solution if you just formatted your partition or card by mistake, drives or card reading “the drive is not formatted, do you want to format it now?”. What’s more? It also can recover files from deleted partition, lost partition, malfunctioned drive, memory card, sd card etc.

As best format recovery software, iCare Format Recovery is easy to use, but works professional to recover files from quick formatted partition, complete formatted partition. Recovering files after formatted FAT, NTFS partition with just a few clicks.

Key features:

# Recovers files after virus attack

# Recovers data from damaged disks

# Hardware RAID and Dynamic Disk Support

# Preview recoverable files before purchasing the product.

# Special developed search algorithm to perform format recovery.

# Works under Microsoft Windows 7, Vista, XP, 2000 Pro; Windows Server NT, 2000, 2003 Server, 2008 Server.

# Supported file systems: FAT12, FAT16, FAT32, NTFS, NTFS5.

# Supported hidden file systems: Hidden FAT12, Hidden FAT16, Hidden FAT32, Hidden NTFS

# Recovers compressed files (NTFS, NTFS5).

# Recovers encrypted files (NTFS5).

# Supports various storage media

Download

The beta release of Microsoft Fix it Center has been released and is available for free download. Microsoft Fix it Center can resolve computer problems quickly with a single click. The Fix it Center houses automated troubleshooters that can fix and fix issues immediately.

According to Microsoft, Fix it Center finds and fixes many common PC and device problems automatically. It also helps prevent new problems by proactively checking for known issues and installing updates. Fix it Center helps to consolidate the many steps of diagnosing and repairing a problem into an automated tool that does the work for you.

You can find more information about the same tool at Fix it Center home. Fix it Center can be installed on Windows XP, Vista, Windows 7, Windows Server 2003, Server 2008 and Server 2008 R2 operating systems.

Download

I’ve got a couple of ASP.NET web sites running on the same web server(windown 2008 server) that need to share access to a Key Container used for encrypting and decrypting authentication tickets.

Sample code for the encryption:

try
{
CspParameters cspParams = new CspParameters();
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
cspParams.KeyContainerName = keyContainerName;
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cspParams);
List<byte> allData = new List<byte>();
}
catch (CryptographicException)
{
// TODO: Log the encryption error
throw;
}

This was encrypting and decrypting fine in the first web site, but the second web site was throwing a CryptographicException “Object Already Exists” when attempting to decrypt the information. After some research it seems this is a security exception to do with access to the key container (basically the ASP.NET user account could tell there was a key container but did not have access to use it for decryption, so was throwing an “Object Already Exists” exception).

This can be fixed with the following command line:
aspnet_regiis -pa “SampleKeys” “NT AUTHORITY\NETWORK SERVICE”

hanging the permission of the folder C:\users\All Users\Microsoft\Crypto\RSA\MachineKeys to everyone full also way to solved this issue.

In this post, I want to take a look at some of the smaller additions, but additions that are really use for increase efficiency with T-SQL.

  • First one is little about compound operators. This is a concept that has been around in programming languages for a long time, but has just now found its way into T-SQL. For example, the += operator will add the values to the current variable and then assign the new value to the variable. In other words, SET @var += 1 is functionally the same as SET @var = @var + 1. This is quicker to type and offers a cleaner piece of finished code.

The complete list of compound operators.

+= Add EQUALS
-= Subtract EQUALS
*= Multiply EQUALS
/= Divide EQUALS
%= Modulo EQUALS
&= Bitwise AND EQUALS
^= Bitwise Exclusive OR EQUALS
|= Bitwise OR EQUALS
(more…)

Beep in C# Windows forms

The following very simple example would alert the user when click the button.hope this will help you .

private void buttonClick_Click(object sender,EventArgs e)

{

System.Console.Beep();

MessageBox.Show (“error…!”);

}

kick it on DotNetKicks.com

Pages (4): « First ... « 1 2 3 4

RSS Feeds

QR Code

qr code

QR code created by QR code Widget

Fun with .NET

Visitors

Your Ads Here
Promote your products