28 January 2008

No Right Click Script

No Right Click Script

Web novices often believe that by blocking their visitors use of the right mouse button that they can prevent the theft of their web page content. Nothing could be further from the truth as there are so many ways to bypass the "no right click script" that the only effects that such a script has is to annoy those of your visitors who legitimately use the context menu (as that menu is properly called) in their web navigation.

Additionally, all of the scripts that I have seen to do this only block access to the context menu from the right muse button. They don't consider the fact that the menu is also accessible from the keyboard. All anyone needs to do to access the menu using a 104 key keyboard is to select the object on the screen that they want to access the context menu for (for example by left clicking on it) and then press the context menu key on their keyboard (it's the one immediately to the left of the right CTRL key) or on a 101 key keyboard hold down the shift key and press F10 to achieve the same effect.

Well here's a really simple script that you can use to block all access to the context menu (not just from the right mouse button but from the keyboard as well) and really annoy your visitors. The script is even simpler than most of the ones that only block the mouse button and works in about as many browsers as those scripts do. Here's the entire script for you:

on body tag add this : body oncontextmenu="return false;"

Adding just that small piece of code to the body tag of your web page is more effective at blocking your visitor's access to the context menu than the many no right click scripts that you can find elsewhere on the web because it blocks access from both the mouse button and the keyboard options described above.

Of course the script doesn't work in all web browsers (eg Opera ignores it - but then Opera ignores all of the no right click scripts as well). It also does nothing to prevent your visitors from accessing the page source using the View Source option from their browser menu, from saving the web page and viewing the source of the saved copy in their favourite editor, or from using a View Source Bookmarklet.

Also, when the context menu has been disabled like this it can be easily re-enabled by typing javascript:void oncontextmenu(null) into the address bar of the browser.

11 January 2008

Access Session in Classes

In Visual Basic .NET, to access a session value:


System.Web.HttpContext.Current.Session(“MyVariable”)
System.Web.HttpContext.Current.Session(“MyVariable”).ToString()



In Visual Basic .NET, to set a session value:


System.Web.HttpContext.Current.Session(“MyVariable”) = “NewValue”

Create Connection to SQL in .NET

Public Function FetchMsSQL() As DataSet
'req namespace:
'Imports System.Data.SqlClient

Dim connString As String = "Data Source=YourServer; Initial Catalog=YourDataBase; User Id=UserInMsSQL; Password=PassInMsSQL;"
Dim sql As String = "SELECT * FROM [table]"

Dim da As New SqlDataAdapter(sql, connString)
Dim ds As New DataSet

da.Fill(ds)
da.Dispose()

Return ds

End Function


* have a nice try.... :)

09 January 2008

Data Type Length

Exact Numerics
Integers

bigint

Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1 (9223372036854775807).

int

Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

smallint

Integer data from 2^15 (-32,768) through 2^15 - 1 (32,767).

tinyint

Integer data from 0 through 255.

bit

bit

Integer data with either a 1 or 0 value.

decimal and numeric

decimal

Fixed precision and scale numeric data from -10^38 +1 through 10^38 –1.

numeric

Functionally equivalent to decimal.

money and smallmoney

money

Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit.

smallmoney

Monetary data values from -214,748.3648 through +214,748.3647, with accuracy to a ten-thousandth of a monetary unit.

Approximate Numerics

float

Floating precision number data from -1.79E + 308 through 1.79E + 308.

real

Floating precision number data from -3.40E + 38 through 3.40E + 38.

datetime and smalldatetime

datetime

Date and time data from January 1, 1753, through December 31, 9999, with an accuracy of three-hundredths of a second, or 3.33 milliseconds.

smalldatetime

Date and time data from January 1, 1900, through June 6, 2079, with an accuracy of one minute.

Character Strings

char

Fixed-length non-Unicode character data with a maximum length of 8,000 characters.

varchar

Variable-length non-Unicode data with a maximum of 8,000 characters.

text

Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters.

Unicode Character Strings

nchar

Fixed-length Unicode data with a maximum length of 4,000 characters.

nvarchar

Variable-length Unicode data with a maximum length of 4,000 characters. sysname is a system-supplied user-defined data type that is functionally equivalent to nvarchar(128) and is used to reference database object names.

ntext

Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters.

Binary Strings

binary

Fixed-length binary data with a maximum length of 8,000 bytes.

varbinary

Variable-length binary data with a maximum length of 8,000 bytes.

image

Variable-length binary data with a maximum length of 2^31 - 1 (2,147,483,647) bytes.

Twiit.. Twiit... Gulp