November 19th, 2008
Tags: .net, asp, asp.net, Cheat sheet, html, LINQ, Microformats, php, Regular Expressions, SQL, xhtml
Posted in General | No Comments »
November 18th, 2008
This is a simply way to show activity while loading, or pausing a site.
Example
This method will output a “.” every second for the designated time. This method uses flush(); to output the current string while we’re inside the for loop.
This can be used to load files within the loop and out put a activity indicator, or pause the site and allow ads to be displayed for a few seconds before proceeding.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| <?php
// Default Message
echo "Loading.";
//Sleep for 20 seconds
$SleepTime = 20;
//Show activity while sleeping
for($i = 0; $i <= $SleepTime; $i++)
{
sleep(1);
echo '.';
flush();
}
// Loading, sleeping, complete
echo "<br /><br />Loaded.";
?> |
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: activity indicator, flush, php, sleep timer
Posted in php | No Comments »
November 18th, 2008
1) Open the Command Prompt (located under Accessories)
2) Type systeminfo
3) Once the system has finished gathering the information, scroll up and the time is displayed in the System Up Time field.
As you can see, running systeminfo also gives a lot of useful information.
You can also use:
net statistics workstation
Look at the top line which should read “Statistics since …”
please wait...
Rating: 10.0/10 (1 vote cast)
Tags: cmd, system, uptime, Windows
Posted in Windows | No Comments »
November 14th, 2008
First we need to change the settings so we can see the password.
Go to: C:\Inetpub\AdminScripts\
And open adsutil.vbs in notepad or any text editor.
Search and replace: IsSecureProperty = True
With: IsSecureProperty = False
Alright we have now set the Secure Property to False so we can see the password in plain text.
To get the IUSR password:
Start up command prompt (Start -> run -> cmd)
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/anonymoususerpass
Results should be something like:
anonymoususerpass : (STRING) “:NX^+N49:67j5$”
To get the IWAM password:
Start up command prompt (Start -> run -> cmd)
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/wamuserpass
Changing the IUSR or IWAM password:
Instead of running a ‘get’ command in your cscript we’re going to run a ’set’ command to set our password. So below is an example of how to set the password for the IUSR account.
C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/anonymoususerpass “P@ssword”
Sync passwords between IIS and MTS:
Last but not least we need to sync the passwords. Simply run the following line and you’re all set:
C:\Inetpub\AdminScripts>cscript.exe synciwam.vbs -v
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: IIS, IUSR, IWAM, MTS, Retreave password, set password
Posted in Cracking, IIS, Security, Windows | No Comments »
November 3rd, 2008
CLS-compliant Exception – Any exception object managed by the .NET Framework. All CLS compliant exception derives from the System.Exception hierarchy. CLS stands for Common Language Specification.
COM (Component Object Model) – Prior to .NET, COM was the fundamental development framework from Microsoft.
COM Callable Wrapper (CCW) – A proxy class that sits between a .NET assembly and a COM component and that allows the COM component to consume the .NET assembly.
Interoperation, interop – managed and unmanaged code working together.
Managed Code – Code that is managed by the .NET Framework runtime.
Marshaling – Moving type data across different execution environments.
Memory Leak – The problem of resource leakage related to memory that is not reclaimed.
Platform Invoke – A mechanism used to call unmanaged code from managed code.
Runtime Callable Wrapper (RCW) – A proxy class that sits between a .COM component and a .NET assembly and that allows the .NET assembly to consume the component.
Type Library Exporter – A tool used to export a >NET type to COM
Type Library Importer - A tool used to import a COM type into .NET
Type Safety – Verification of a given type so that mismatches cannot occur.
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: 70-536, interoperation, Key Terms, study guide
Posted in .net, 70-536, C# | No Comments »
November 3rd, 2008
Attribute – A specific class type in the .NET framework that allows for declarative binding of code.
Debug – A specific constant defined in an application that allows debugger objects to be attached to code.
Debugger – A class that provides access to the default debugger attached to an application
Event log – A mechanism that allows an application to record information about its state and persist it permanently.
Management Query – A request for information about a Windows Management Instrumentation object.
Performance Counter – A mechanism to measure performance of code that is executing.
Process – An application that is currently running. Processes allow for resource isolation.
StackTrace – An ordered collection of one or more StackFrame objects.
Windows Management Instrumentation – A technology that provides access to information about objects in a managed environment.
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: .net, 70-536, C#, instrumentatioin, Key Terms, study guide
Posted in .net, 70-536, C# | No Comments »
November 3rd, 2008
Application Setting – A custom setting that the application reads, writes, or both.
Configuration Management – The practice of handling and managing how an application is set up and configured.
Connection String – A specific value used by an application to connect to a given database. All ODBC and OleDb compliant databases use a connection string. For security those should always be encrypted.
.NET Framework 2.0 Configuration Tool (Mscorcfg.msc) – A tool provided by the .NET framework that allows visual configuration and management of applications and assemblies.
http://msdn.microsoft.com/en-us/library/2bc0cxhc(VS.80).aspx
Roll back – An action taken in cases where an installation does not complete successfully. To roll back means to undo any changes made up until the point of failure so that the machine is returned to the state is was in prior to the installation attempt.
Uninstall – Getting rid of any remnants of an application so that the machine looks identical to how it would have had the application never been installed.
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: 70-536, installing and configuring applications, Key Terms, study guide
Posted in .net, 70-536, C# | No Comments »
November 3rd, 2008
Application domain – A logical container that allows multiple assemblies to run within a single process, while preventing them from directly accessing another assembly’s memory.
Assembly evidence – Evidence that an assembly presents that describes the assembly’s identity, such as the hash, the publisher, or the strong name.
Defense-in-depth – The security principle of providing multiple levels of protection so that your system is still protected in the event of vulnerability.
Evidence – The way an assembly is identified, such as the location where the assembly is stored, a hash of the assembly’s code, or the assembly’s signature. The information that the runtime gathers about an assembly is then used to determine which code groups the assembly belongs to. The code groups, in turn, determine the assembly’s privileges.
LocalService – A service account that runs with very limited privileges
LocalSystem – A service account that runs with almost unlimited privileges.
NetworkService – A service account that is capable of authenticating to remote computers.
Service – A process that runs in the background, without a user interface, in its own user session.
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: .net, 70-536, Application domain and services, C#, Key Terms, study guide
Posted in .net, 70-536, C# | No Comments »
November 3rd, 2008
Threading in C#
http://www.albahari.com/threading/
C# Programmer’s Reference Threading Tutorial
http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx
Summary:
The advantage of threading is the ability to create applications that use more than one thread of execution. For example, a process can have a user interface thread that manages interactions with the user and worker threads that perform other tasks while the user interface thread waits for user input.
Code Example (C#):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| static void Main(string[] args)
{
ThreadStart starter = new ThreadStart(counting);
Thread first = new Thread(starter);
Thread second = new Thread(starter);
first.Start();
second.Start();
first.Join();
second.Join();
Console.Read();
}
static void counting()
{
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("Count: {0} - Thread: {1}", i, Thread.CurrentThread.ManagedThreadId);
Thread.Sleep(10);
}
} |
Asynchronous Programming Model – A pattern of working with specific types of .NET classes that use begin/End method pairs to provide asynchronous execution of certain methods.
Thread – A single synchronous line of execution of code.
Mutex - A synchronization primitive that can also be used for interprocess synchronization. Used to synchronize threads.
http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx
Semaphor - Limits the number of threads that can access a resource or pool of resources concurrently. Used to throttle threads.
http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx
Timer – a basic object that will fire off an asynchronous call to a method based on time. There are three Timer classes. System.Threading.Timer, System.Windows.Forms.Timer and the System.Timers.Timer
Windows Kernel Objects – Operating system provided mechanisms that perform cross process synchronization. These include mutexes, semaphores, and events.
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: 70-536, study guide, threading
Posted in .net, 70-536, C# | No Comments »
November 3rd, 2008
BinaryFormatter – Located in the System.Runtime.Serialization.Formatters.Binary namespace, this formatter is the most efficient way to serialize objects that will be read only by .NET Framework-based applications.
Deserialization – The process of converting a previously serialized sequence of bytes into an object.
Serialization – The process of serializing and deserializing objects so that they can be stored or transferred and then later re-created.
Code Example (C#):
1
2
3
4
5
| string data = "This string is set to be Serialized.";
FileStream fs = new FileStream("SerializedString.Data", FileMode.Create);
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(fs, data);
fs.Close(); |
SoapFormatter – XML based formatting is the most reliable way to serialize objects that will be transmitted across a network or read by a non-.NET Framework application. SoapFormatter is more likely to successfully traverse firewalls than BinaryFormatter.
XML (eXtensible Markup Language) - is a generic format intended for maximum flexibility to provide information in a wide variety of structural formats.
Code Example (C#):
Serialize XML:
1
2
3
4
| FileStream fs = new FileStream("SearializedDate.xml", FileMode.Create);
XmlSerializer xs = new XmlSerializer(typeof(DateTime));
xs.Serialize(fs, System.DateTime.Now);
fs.Close(); |
Deserialize XML:
1
2
3
4
5
| FileStream fs = new FileStream("SearializedDate.xml", FileMode.Open);
XmlSerializer xs = new XmlSerializer(typeof(DateTime));
DateTime previousTime = (DateTime)xs.Deserialize(fs);
fs.Close();
Console.WriteLine("Day: " + previousTime.DayOfWeek + ", Time: " + previousTime.TimeOfDay.ToString()); |
please wait...
Rating: 0.0/10 (0 votes cast)
Tags: binaryformatter, deserialization, XML
Posted in .net, 70-536, C# | No Comments »