ASP.NET: UpdatePanel and Master Pages

I had an ASP.NET page with two UpdatePanel controls. I wanted to handle the page refresh differently depending on whether the user clicked on the button in the first UpdatePanel or whether the click was on the button in the second UpdatePanel.

After a little time with Bing, I found the IsInAsyncPostBack and AsyncPostBackSourceElementId properties of the ScriptManager and thought I was good to go. But no. The page had no ScriptManager control because the ScriptManager was on the master page.

I had put the ScriptManager on the master page because almost every one of my pages needs some AJAX control or another. I didn't want to move it onto every page.

So back to Bing for more research. I found several solutions for getting the ScriptManager from the master page, one of which required about 60 lines of code.

Then I found this one:

In C#:

protected void Page_Load(object sender, EventArgs e)
{
    if (this.IsPostBack)
    {
        ScriptManager sm = ScriptManager.GetCurrent(this.Page);
        if (sm != null && sm.IsInAsyncPostBack)
        {
            if (sm.AsyncPostBackSourceElementID ==
                           AddButton.UniqueID)
            {
                //  Do whatever
            }
            else
            {
                //  Do the other thing
            }
        }
    }
    else
    {
        // Setup the page text and populate lists. 
    }

}

In VB:

Protected Sub Page_Load(ByVal sender As Object, _
                    ByVal e As System.EventArgs) Handles Me.Load
    If IsPostBack Then
        Dim sm As ScriptManager = ScriptManager.GetCurrent(Me.Page)
        If sm IsNot Nothing AndAlso sm.IsInAsyncPostBack Then
            If sm.AsyncPostBackSourceElementID = _
                           AddButton.UniqueID Then
            '  Do whatever
            Else
            '  Do the other thing
            End If 
        End If
    Else
        ' Setup the page text and populate lists.
    End If

End Sub

This code uses the ScriptManager GetCurrent static method to find the ScriptManager associated with the page. It then uses that instance to check the IsInAsyncPostBack property. The AsyncPostBackSourceElementId provides the unique Id of the element on the page that generated the post back.

Use this technique whenever you need to obtain the ScriptManager from the master page.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , , ,

ASP.NET: Styling a GridView

This post provides some tips for styling the GridView control.

The prior post here demonstrates how to use the GridView with your business objects. This post builds upon that example and demonstrates how to style a GridView. Use these techniques any time you want to add some style to your GridView control, regardless of how the GridView was populated.

By default, a sorted and paged DataGrid looks something like this:

image

In this example, the application color scheme was a shade of orange, so the desired GridView design is as follows:

image

But you can replace the color with whatever color matches your design.

If you plan to use stylesheets, which I highly recommend, then styling your GridView requires two steps. First, define the desired stylesheet elements. Second, apply the style elements in the GridView tag.

Define the Stylesheet Elements

Define the desired stylesheet elements in the CSS file for your application. In this example, the stylesheet is called SampleStyleSheet.css.

In CSS:

/*----------- Grid -----------------------------------*/
.GridHeader
{
    color:#C16914;           
    font-weight:bold;
}

.GridHeader a
{
    color:#C16914;           
    font-weight:bold;
}

.GridHeader a:active
{
    color:Black;           
    font-weight:bold;
}

.GridRow
{
    color:#C16914;
}

.GridAlternatingRow
{
    background-color:#f2f2f2;    /* Light gray */
    color:#C16914;                           
}

.GridPager
{
    color:#C16914;               
    font-weight:bold;
}

.GridPager a
{
    color:#C16914;               
    font-weight:normal;
}

In this example where the grid is sortable, the grid header is a hyperlink. So the .GridHeader CSS class is not really used. The .GridHeader a element is used to show the hyperlinks in the column header of the grid. The .GridHeader a:active element defines how the hyperlink should look when it is activated. By setting a different color in the a and a:active styles, the hyperlink changes color while the grid is sorted.

The .GridRow CSS class defines the style for the basic grid row. In this case, the text color is set to the orange color scheme, but you can set it to any color. If you want the standard rows to have a background color, you can set that as well.

The .GridAlternatingRow CSS class defines the style for every other row. In this example, the color remains the same as the normal row, but a light gray background color is set.

The .GridPager CSS class defines the style for the current page because the current page is *not* shown with a hyperlink. In this example, the current page is shown in bold.

The .GridPager a element defines the style for the other page numbers that are shown as hyperlinks.

Define the GridView

Define the GridView control in your ASP.NET page using the styles defined in the prior step.

In HTML:

<asp:GridView ID="CustomerGridView" runat="server"
    AllowPaging="true" PageSize="3"
    AllowSorting="true"
    AutoGenerateColumns="false">
    <HeaderStyle CssClass="GridHeader" />
    <RowStyle CssClass="GridRow" />
    <AlternatingRowStyle CssClass="GridAlternatingRow" />
    <PagerStyle CssClass="GridPager" />
    <Columns>
        <asp:BoundField HeaderText="Last Name"
            DataField="LastName" SortExpression="LastName" />
        <asp:BoundField HeaderText="First Name"
            DataField="FirstName" SortExpression="FirstName" />
        <asp:BoundField HeaderText="Email" 
            DataField="EmailAddress" SortExpression="EmailAddress" />
    </Columns>
</asp:GridView>

Notice that the styles are set in the HeaderStyle, RowStyle, AlternatingRowStyle, and PagerStyle elements within the asp:GridView tag.

Set the GridView styles any time you want your GridView to match your ASP.NET application design.

Enjoy!

Posted by Deborah Kurata | with no comments
Filed under: , , , ,

Nintendo pirate to pay $1.5m

A Queensland man will have to pay Nintendo $1.5 million in damages after illegally copying and uploading one of its new games to the internet ahead of its release, the gaming giant says.

James Burt, 24, of Sinnamon Park in Queensland will pay Nintendo $1.5 million after an out-of-court settlement was struck to compensate the company for the loss of sales revenue.

Nintendo said the loss was caused when Burt made New Super Mario Bros for the Wii gaming console available for illegal download a week ahead of its official Australian release in November last year.

Under Australian law, copying and distributing games without the permission of the copyright holder is a breach of the Copyright Act.

Nintendo applied and was granted a search order by the Federal Court forcing Burt to disclose the whereabouts of all his computers, disks and electronic storage devices in November.

http://www.smh.com.au/digital-life/games/nintendo-pirate-to-pay-15m-20100209-np4i.html

Posted by donna | with no comments

Five Ways Early Adopters Have Been Screwed

Apple executives have hinted that an early price drop for the $500-and-up iPad may be in the works. A Credit Suisse analyst who reportedly met with Apple executives learned that Apple may slash the price of the iPad if demand for the new device is low.

For eager iPad early adopters that could turn out to be a big iBummer, but then again, the news of an iPad price drop should not be coming as a shock. Most technology companies have a history of screwing over their first batch of customers with price cuts and early upgrades, and Apple is no exception. In fact, Apple was behind one of the most famous early adopter scandals of all time.

So before you go spending your money on the first edition of the iPad, let's take a quick look back at just a few times when early adopters were left out in the cold by buying technology products before anyone else.

  • iPhone
  • Blu-Ray
  • Tivo Down Under
  • Wal-Mart Music Downloads
  • Kindle 2 and DX

http://www.pcworld.com/article/188889/ipad_early_adopters.html

Posted by donna | with no comments

Lumension Launches New eBook, “Shift Happens: The Evolution In Application Whitelisting”

EBook Outlines Why Organizations Need to Shift from a Threat Centric Approach to a Trust Centric Endpoint Security Model to Eliminate Risks, Reduce Complexity, and Lower TCO

Shift happens. The threat landscape has changed for the worse as evidenced by the recent highly publicized attacks by hackers who used sophisticated methods to steal core intellectual property from Google, Adobe, and other high profile companies. Cyber criminals have become more agile than ever, insiders have increasingly taken advantage of trust and new Web 2.0 technologies have given both parties open access to sensitive data stores. Traditional technologies such as antivirus and firewalls can no longer act as the mainstay of modern security programs. The year 2009 was believed to be the tipping point of a cybercrime epidemic in which more malware was identified than any other time in the history of computing. With current growth rates of malware, it is feasible to see billions if not trillions of malware signatures within the span of a few short years. Organizations must begin to shift from a threat centric approach where the focus is on stopping what is known to be bad, to a trust centric model where the focus is on protecting what is known to be good and trusted in order to achieve greater intelligence around endpoint risks. In doing so, organizations will better eliminate risk, reduce complexity, lower TCO and improve overall endpoint security and compliance posture.

Lumension, the global leader in endpoint management and security, today unveiled a new eBook titled, “Shift Happens: The Evolution in Application Whitelisting.” The eBook is designed to arm security professionals with a better understanding of the new endpoint security risks to confidential data and proprietary systems and why organizations must make a shift away from traditional approaches to endpoint security models and look to adopt a trust centric model with application whitelisting.

“Whitelisting may be perceived as a new novel idea, but the old oak trees of IT security will tell you that it is hardly a new approach to shoring up systems,” Paul Zimski, vice president of solution marketing, Lumension. [...]

To download the free eBook, click on Shift Happens: The Evolution in Application Whitelisting.

http://news.yahoo.com/s/prweb/20100209/bs_prweb/prweb3582184

Posted by donna | with no comments

UG Recording

Thank you to those people who joined the Live Meeting tonight. The recording details are below.  It will be available for 365 days from now.

Richard Siddaway has invited you to view a Microsoft Office Live Meeting recording.
View Recording
Recording Details
    Subject: PowerShell UG
    Recording URL: https://www.livemeeting.com/cc/usergroups/view
    Recording ID: 5JCG5C
    Attendee Key: X8g}hNd[c

This Office Live Meeting invitation is a personal invitation meant only for you. It should not be forwarded. If you received this email by mistake or require Live Meeting Assistance, please refer to the Live Meeting Assistance Center at http://r.office.microsoft.com/r/rlidLiveMeeting?p1=12&p2=en_US&p3=LMInfo&p4=support

The slides and demo scripts can be downloaded from http://cid-43cfa46a74cf3e96.skydrive.live.com/browse.aspx/PowerShell%20User%20Group/February%5E_2010

Technorati Tags: ,
Posted by RichardSiddaway | with no comments

Orange Regional Website Hacked

Sixty thousand accounts compromised

A Lebanese hacker claims to have hacked Orange's regional website in Cote d'Ivoire (Ivory Coast) through SQL injection. The attack allegedly gave him access to the website's administration interface and information on almost 60,000 customers.

Orange is the fifth largest telecom provider in the world with a presence in 166 countries and territories and an estimated 189 million subscribers. According to information on its website, Orange Cote d'Ivoire was the group's first subsidiary on the African continent and has over 4 million customers.

In an e-mail to Softpedia, a self-confessed grey hat hacker going by the name of Idahc took credit for compromising the organge.ci domain. The attached screenshots and a video demonstration clearly show the hacker navigating through the website's administration interface at will.

The site seems to have been compromised around the date of January 25, when Idahc used the administrative credentials to add a news story entitled "Hacked by Idahc" on the website. The entry is still online at the time of publishing, suggesting that the webmasters might not be aware of the security breach.

However, it appears that Idahc is not the only hacker to have targeted the orange.ci domain recently. According to a post on Web defacement archive Zone-H.org, someone else hacked the server and uploaded a rogue HTML file back in December. Similar to Idahc's news story, that file is still online and reads "3viLboy was here."

http://news.softpedia.com/news/Orange-Regional-Website-Hacked-134467.shtml

Posted by donna | with no comments

Sunbelt supports Safer Internet Day: Think B4 U post!

Sunbelt Software is supporting tomorrow’s Safer Internet Day, an awareness-raising initiative co-funded by the European Commission. Organizations in more than 60 countries are behind the campaign, this year focusing on the theme "Think B4 U post!"

New technologies have turned all of us, and mostly young people, into publishers of information, pictures, and videos. While bringing about new opportunities for personal expression and creativity, the same technologies can also conjure up embarrassing or even traumatic situations. For example, photos, once posted online, remain online and can be seen by anybody, even years after they have been posted. Therefore, children and teenagers need guidance to manage their online identity in a responsible way, to be in control of their own online identity.

“We are proud to be supporting Safer Internet Day. Whilst it is generally assumed that the latest generation will be the most technologically savvy, we see that children are taking increasingly liberties with their online identity and opening themselves up to a wealth of very real dangers,” explained Sunbelt Software CEO Alex Eckelberry. “By following this simple five point checklist they can enjoy the many social and academic benefits of the Internet safely.”

http://sunbeltblog.blogspot.com/2010/02/sunbelt-supports-safer-internet-day.html

Posted by donna | with no comments

The 13 Security Bulletins Microsoft for this month...

We got a huge number of Microsoft security updates today:

  1. MS10-003 - Vulnerability in Microsoft Office (MSO) Could Allow Remote Code Execution (978214)
  2. MS10-004 - Vulnerabilities in Microsoft Office PowerPoint Could Allow Remote Code Execution (975416)
  3. MS10-005 - Vulnerability in Microsoft Paint Could Allow Remote Code Execution (978706)
  4. MS10-006 - Vulnerabilities in SMB Client Could Allow Remote Code Execution (978251)
  5. MS10-007 - Vulnerability in Windows Shell Handler Could Allow Remote Code Execution (975713)
  6. MS10-008 - Cumulative Security Update of ActiveX Kill Bits (978262)
  7. MS10-009 - Vulnerabilities in Windows TCP/IP Could Allow Remote Code Execution (974145)
  8. MS10-010 - Vulnerability in Windows Server 2008 Hyper-V Could Allow Denial of Service (977894)
  9. MS10-011 - Vulnerability in Windows Client/Server Run-time Subsystem Could Allow Elevation of Privilege (978037)
  10. MS10-012 - Vulnerabilities in SMB Server Could Allow Remote Code Execution (971468)
  11. MS10-013 - Vulnerability in Microsoft DirectShow Could Allow Remote Code Execution (977935)
  12. MS10-014 - Vulnerability in Kerberos Could Allow Denial of Service (977290)
  13. MS10-015 - Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165)

The full version of their bulletin summary is in http://www.microsoft.com/technet/security/Bulletin/MS10-feb.mspx and MSRC's blog entry on the above is in http://blogs.technet.com/msrc/archive/2010/02/09/february-2010-security-bulletin-release.aspx

Posted by donna | with no comments

Microsoft Security Bulletin Minor Revisions - February 9, 2010

Issued: February 9, 2010

Summary


The following bulletins have undergone a minor revision increment.
Please see the appropriate bulletin for more details.

* MS10-002 - Critical
* MS09-060 - Critical

Bulletin Information:

* MS10-002 - Critical

- http://www.microsoft.com/technet/security/bulletin/ms10-002.mspx
- Reason for Revision: V1.2 (February 9, 2010): Added entry to the
Update FAQ to clarify how the URL Validation Vulnerability
(CVE-2010-0027) is addressed by both this update (MS10-002)
and the MS10-007 update. Also, corrected the severity rating
for Internet Explorer 6 Service Pack 1 when installed on
Microsoft Windows 2000 Service Pack 4 for CVE-2010-0027.
- Originally posted: January 21, 2010
- Updated: February 9, 2010
- Bulletin Severity Rating: Critical
- Version: 1.2

* MS09-060 - Critical

- http://www.microsoft.com/technet/security/bulletin/ms09-060.mspx
- Reason for Revision: V1.4 (February 9, 2010): Revised this
bulletin to announce a detection logic change to fix the
issue where the July 8, 2008 update for Outlook 2003
(KB953432) was incorrectly being offered in addition to the
update package for Microsoft Office Outlook 2003 (KB973705).
This is a deployment change only that does not affect the
files contained in the initial update. Customers who have
successfully updated their systems do not need to reinstall
this update.
- Originally posted: October 13, 2009
- Updated: February 9, 2010
- Bulletin Severity Rating: Critical
- Version: 1.4

Posted by Don

Microsoft Security Advisory Notification - February 9, 2010

Issued: February 9, 2010

Security Advisories Updated or Released Today

* Microsoft Security Advisory (979682)
- Title: Vulnerability in Windows Kernel Could Allow
Elevation of Privilege
- http://www.microsoft.com/technet/security/advisory/979682.mspx
- Revision Note: V2.0 (February 9, 2010): Advisory updated to
reflect publication of security bulletin.
* Microsoft Security Advisory (977377)
- Title: Vulnerability in TLS/SSL Could Allow Spoofing
- http://www.microsoft.com/technet/security/advisory/977377.mspx
- Revision Note: V1.0 (February 9, 2010): Advisory published.

Posted by Don

So why use http://connect revisited

Okay so I was wrong.  There's some magic in http://connect but the rest is the magic of group policy.

First off if you have a local profile it will move that local profile to the domain profile.

And that's where the SBS magic stops.

What happens next will happen whether or not you use the sbs connect or merely manually install the workstations.  All of the rest of the magic is actually pushed out by group policy.. not by any voodoo done by the SBS box.

•    Create a Windows SBS group on the Start menu, and place the Internal Web site link in the group.
•    Create a shortcut to the internal Web site on the desktop of computers running the Windows XP operating system.
•    Set the Home page link in Internet Explorer to point to the internal Web site.
•    Create favorite links in Internet Explorer for the Internal Web site, Outlook Web Access, and Remote Web Workplace.
•    Configure Windows Firewall ports to allow the following features to work:
•    Core Networking
•    Remote Assistance
•    Remote Desktop
•    Windows Management Instrumentation (WMI)
•    Configure Automatic Update on the client computer to install updates automatically.
•    Install the Windows Small Business Server 2008 Client Agent application on the client computer (Client Side Extension).
•    Configure the Windows Small Business Sever 2008 WMI Provider to help ensure system health monitoring.
•    Install the Windows SBS 2008 Desktop Links gadget on client computers running the Windows Vista operating system.
•    Deploys an outlook 2003 PRF auto configuration profile (Outlook 2007 utilizes Exchange 2007 autodiscover to connect)

All of that is all done via group policy.

Now about that Vista/Win7 gadget.  On a Win7/Vista box right mouse click on the right side and click on add gadgets.

There will be a SBS gadget in there.

Click on it and you'll get a short cut to key items

 

This gadget works when you are domain joined, not when you are not domain joined.

Posted by bradley | with no comments
Filed under:

TechNet Webcast: Information About Microsoft February Security Bulletins

Language(s): English.
Product(s): Security.
Audience(s): IT Generalist.
Duration: 90 Minutes
Start Date:
Wednesday, February 10, 2010 11:00 AM Pacific Time (US & Canada)
 

Event Overview

Join us for a brief overview of the technical details of the February security bulletins. We intend to address your concerns in this webcast, therefore, most of the webcast is devoted to attendees asking questions about the bulletins and getting answers from Microsoft security experts.

Presenters: Jerry Bryant, Senior Security Program Manager Lead, Microsoft Corporation and Adrian Stone, Senior Security Program Manager Lead, Microsoft Corporation

Register Online


Posted by Don
Filed under:

Solution: ConfigMgr2007 SP2 Setup stuck in Upgrade status

  I recently ran into this issue a couple days ago and didn't see a whole lot documented on it so I thought I would do a quick write up here.  If you're trying to upgrade some of your site servers to SP2 and run into an issue, this should...

Microsoft Security Bulletin(s) for February 9, 2010

Note: There may be latency issues due to replication, if the page does not display keep refreshing

Today Microsoft released the following Security Bulletin(s).

Note: »www.microsoft.com/technet/security and »www.microsoft.com/security are authoritative in all matters concerning Microsoft Security Bulletins! ANY e-mail, web board or newsgroup posting (including this one) should be verified by visiting these sites for official information. Microsoft never sends security or other updates as attachments. These updates must be downloaded from the microsoft.com download center or Windows Update. See the individual bulletins for details.

Because some malicious messages attempt to masquerade as official Microsoft security notices, it is recommended that you physically type the URLs into your web browser and not click on the hyperlinks provided.

Bulletin Summary:

»www.microsoft.com/technet/securi···feb.mspx

Critical (5)

Microsoft Security Bulletin MS10-006
Vulnerabilities in SMB Client Could Allow Remote Code Execution (978251)
»www.microsoft.com/technet/securi···006.mspx

Microsoft Security Bulletin MS10-007
Vulnerability in Windows Shell Handler Could Allow Remote Code Execution (975713)
»www.microsoft.com/technet/securi···007.mspx

Microsoft Security Bulletin MS10-008
Cumulative Security Update of ActiveX Kill Bits (978262)
»www.microsoft.com/technet/securi···008.mspx

Microsoft Security Bulletin MS10-009
Vulnerabilities in Windows TCP/IP Could Allow Remote Code Execution (974145)
»www.microsoft.com/technet/securi···009.mspx

Microsoft Security Bulletin MS10-013
Vulnerability in Microsoft DirectShow Could Allow Remote Code Execution (977935)
»www.microsoft.com/technet/securi···013.mspx

Important (7)

Microsoft Security Bulletin MS10-003
Vulnerability in Microsoft Office (MSO) Could Allow Remote Code Execution
»www.microsoft.com/technet/securi···003.mspx

Microsoft Security Bulletin MS10-004
Vulnerabilities in Microsoft Office PowerPoint Could Allow Remote Code Execution (975416)
»www.microsoft.com/technet/securi···004.mspx

Microsoft Security Bulletin MS10-010
Vulnerability in Windows Server 2008 Hyper-V Could Allow Denial of Service (977894)
»www.microsoft.com/technet/securi···010.mspx

Microsoft Security Bulletin MS10-011
Vulnerability in Windows Client/Server Run-time Subsystem Could Allow Elevation of Privilege (978037)
»www.microsoft.com/technet/securi···011.mspx

Microsoft Security Bulletin MS10-012
Vulnerabilities in SMB Server Could Allow Remote Code Execution (971468)
»www.microsoft.com/technet/securi···012.mspx

Microsoft Security Bulletin MS10-014
Vulnerability in Kerberos Could Allow Denial of Service (977290)
»www.microsoft.com/technet/securi···014.mspx

Microsoft Security Bulletin MS10-015
Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165)
»www.microsoft.com/technet/securi···015.mspx

Moderate (1)

Microsoft Security Bulletin MS10-005
Vulnerability in Microsoft Paint Could Allow Remote Code Execution (978706)
»www.microsoft.com/technet/securi···005.mspx

Please note that Microsoft may release bulletins out side of this schedule if we determine the need to do so.

If you have any questions regarding the patch or its implementation after reading the above listed bulletin you should contact Product Support Services in the United States at 1-866-PCSafety 1-866-727-2338. International customers should contact their local subsidiary.

As always, download the updates only from the vendors website - visit Windows Update and Office Update or Microsoft Update websites. You may also get the updates thru Automatic Updates functionality in Windows system.

Security Tool
Find out if you are missing important Microsoft product updates by using MBSA

Posted by Don

Anybody remember ‘Judy Patch’?

I have been trawling through some of my saved URL’s and came across this one. At the time, it was difficult to determine if the website was for real or just an attempt at comedy. Personally, I believe that it was constructed in all good faith that it would be of help to people.I don’t think that Judy Patch is still doing this, thankfully.

Judy Patch was not and is not alone. There are many ‘have a go’ heroes in this world, and some may be living not too far away from you. They are generally recommended by a friend of a friend. Finding a good local computer technician is not always easy to find. In Judy’s case, a look at her website would be enough to set alarm bells ringing.

This is an excerpt from ‘Judy Patch’ self help website. I have made no changes to the content whatsoever. For posterity, you can save a link to what remains of the original website.. http://www.leenks.com/link19958.htm 

-------------------------------------------------------------------------------------

Angelfire finally restored my web site, a hacker got into my main frame and got my hard drives Ip Address. Im taking donations at my paypal address so I can recover from this unfortunate event and continue to produce my informational CD about how computers work. If everyone could donate $1 I would be much obliged.

Hello, and welcome to my guide on computer hardware for beginners.

My name is Judy Patch and I have always been fascinated by computers.

I wrote this guide to inform others on the basic hardware components of today's standard home P.C.s


This site is sill a working progress, being my first website, its not perfect. Please email any queries, tips, etc Alternitavely, you can contact me via MSN messenger using this address. Thank you

-Judy

Central Programming Unit

the C.P.U. (or 'motherboard' as it is more commonly known) is the main part of hardware you need to know about. It is a large circuit that is made up of tiny microscopic wires and connections that pass data to different parts of the computer.

All computers have C.P.U.s

The C.P.U. has many plugs and slots for various other pieces of computer hardware such as R.A.M., a chip, cards, FDD disk drives, A.G.P. cards etc...

The C.P.U. looks quite complicated, but is in fact quite simple.

A C.P.U.'s speed is measured by the amount of busses it has. A Bus is a tiny microscopic electronic component that carries computer data. The more busses a cpu has, the more data can be carried at once, the faster it is. Most of today's modern C.P.U.s have over 700 busses.

An image of a typical CPU unit

Chip

The chip is, in a sense, the 'brain' of the computer. it plugs into a special slot in the the C.P.U. and processes all the computers data. The chip's speed is measured in Megahertz (mhz) the more mhz the chip has, the faster it is.

There are three main types of chips, Celeron, Pentium and A.M.D. There are no distinct differences between the three, just different brands, although, Pentium is the most widely known and is suported by most, if not all, software companies.

The chip has many pins on its under-face, these pins slot into the holes of the C.P.U.'s chip-slot so it can communicate with the C.P.U.

A Pentum chip

Random Access Memory

Random access memory, or R.A.M. is used by the computer to store files and data until the P.C. is shut down.

whenever you create a file, edit a document or make any similar changes, all this information is stored in your R.A.M. until you shut down, then it is transferred onto your HDD disk drive. Ofcourse a computer runs better if it has more R.A.M., the standard amout of R.A.M. for todays home P.C.s is about 512 mgb of R.A.M.

There are different types of R.A.M. which include EDO, SD and DDR. There is a new standard of R.A.M. beginning sale this year, it is known as DDR2 which holds more data than normal DDR R.A.M.

DDR3 is also expected to go on sale in early 2007 which will be able to hold even more data than DDR and DDR2.

A R.A.M. unit

HDD Disk Drive

HDD Disk Drives or 'Hard Drives' are where all the computers data is stored when the computer is off.

R.A.M. cannot keep data stored unless it has power, whereas hard drives can hold data even when no power is present. Hard drives come in a range of sizes, but the standard for today is about 80 gb.

Every Hard drive has a unique IP address. An IP address is used by the internet so the governmnet can keep track of you. That way if someone is doing something illegal, such as hacking, the government or police can identify this person by their IP address, simmilar to a cars liscence plate.

Some hackers however, have found ways to steal peoples IP address by using special virusses called trojan horses. Once the hacker has stolen someones IP address, they can use it while hacking to avoid being caught.

stealing IP addresses is illegal and I will not be explaining how to do it here.

A typical HDD Disk Drive

Posted by Mike Hall | with no comments
Filed under: ,

Adding disks into a cluster using PowerShell

With Windows 2008 R2, we now have the option to use PowerShell when you want to look at things in the cluster from a command line along with the cluster.exe command. If you want to add a disk to a cluster using PowerShell, there are several different options.

In my previous article, I explained how to add a disk in Windows 2008. This still applies to 2008 R2, but if you’re more comfortable using PowerShell, here are a couple of ways to do this. I am a novice PowerShell user so my examples are just some of the ways of accomplishing this task. Of course there are other ways to do it, so feel free to leave comments with your examples.

If you’ve got a disk that shows up as an available disk, adding a disk through PowerShell is very straight forward. Here's how we can check to see if there are any available disks for cluster:

PS C:\> Get-ClusterAvailableDisk

Cluster    : MyCluster
Name       : Cluster Disk 2
Number     : 6
Size       : 17425367040
Partitions : {X:}
Id         : 0xB6F579CA
                                                                                   

For this disk, the easiest way to add it to the cluster would be to use the following command:

PS C:\> Get-ClusterAvailableDisk | Add-ClusterDisk

Name                          State                         Group                         ResourceType
----                          -----                         -----                         ------------
Cluster Disk 2                OnlinePending                 Available Storage             Physical Disk

This command would add all disks from the Get-ClusterAvailableDisk output into the Available Storage group in your cluster using the default (terrible) naming convention for cluster disks. This is a nice little command to quickly add disks to the cluster. However, if you’re in a situation where the disk is NOT showing up in the Get-ClusterAvailableDisk output, like in a multi-site cluster, we’ll need to work a little harder to add the disk into the cluster. Previously, I showed how this was done using cluster.exe so we can apply these same concepts to PowerShell. First, we’ll create the empty resource:

PS C:\> Add-ClusterResource -Group "Available Storage"

cmdlet Add-ClusterResource at command pipeline position 1
Supply values for the following parameters:
Name: Disk X:
ResourceType: Physical Disk

Name                          State                         Group                         ResourceType
----                          -----                         -----                         ------------
Disk X:                       Offline                       Available Storage             Physical Disk

In this example, the Add-ClusterResource command prompted me for the missing parameters for the command. I manually specified the Disk X: value and the Physical Disk resource type. I can avoid having to manually enter these by specifying the -Name and -ResourceType values in the command:

PS C:\> Add-ClusterResource -Name "Disk X:" -ResourceType "Physical Disk" -Group "Available Storage"
	
Name                          State                         Group                         ResourceType
----                          -----                         -----                         ------------
Disk X:                       Offline                       Available Storage             Physical Disk

So at this point, I have an empty disk resource with no parameters to identify the disk:

PS C:\> Get-ClusterResource "Disk X:" | Get-ClusterParameter

Object                        Name                          Value                         Type
------                        ----                          -----                         ----
Disk X:                       DiskIdType                    5000                          UInt32
Disk X:                       DiskSignature                 0x0                           UInt32
Disk X:                       DiskIdGuid                                                  String
Disk X:                       DiskRunChkDsk                 0                             UInt32
Disk X:                       DiskUniqueIds                 {}                            ByteArray
Disk X:                       DiskVolumeInfo                {}                            ByteArray
Disk X:                       DiskArbInterval               3                             UInt32
Disk X:                       DiskPath                                                    String
Disk X:                       DiskReload                    0                             UInt32
Disk X:                       MaintenanceMode               0                             UInt32
Disk X:                       MaxIoLatency                  1000                          UInt32
Disk X:                       CsvEnforceWriteThrough        0                             UInt32
Disk X:                       DiskPnpUpdate                 {}                            ByteArray


I would then need to issue the following command in order to set the DiskPath value and query the output:

PS C:\> Get-ClusterResource "Disk X:" | Set-ClusterParameter DiskPath "X:"

PS C:\> Get-ClusterResource "Disk X:" | Get-ClusterParameter

Object                        Name                          Value                         Type
------                        ----                          -----                         ----
Disk X:                       DiskIdType                    5000                          UInt32
Disk X:                       DiskSignature                 0x0                           UInt32
Disk X:                       DiskIdGuid                                                  String
Disk X:                       DiskRunChkDsk                 0                             UInt32
Disk X:                       DiskUniqueIds                 {}                            ByteArray
Disk X:                       DiskVolumeInfo                {}                            ByteArray
Disk X:                       DiskArbInterval               3                             UInt32
Disk X:                       DiskPath                      X:                            String
Disk X:                       DiskReload                    0                             UInt32
Disk X:                       MaintenanceMode               0                             UInt32
Disk X:                       MaxIoLatency                  1000                          UInt32
Disk X:                       CsvEnforceWriteThrough        0                             UInt32
Disk X:                       DiskPnpUpdate                 {}                            ByteArray

At this point, I would bring the disk online and the cluster will then perform its magic to translate the DiskPath into the DiskSignature and other properties of the disk. Much like cluster.exe, I can use PowerShell to online the disk using the Start-ClusterResource command:

PS C:\> Start-ClusterResource "Disk X:"

Name                          State                         Group                         ResourceType
----                          -----                         -----                         ------------
Disk X:                       Online                        Available Storage             Physical Disk

PS C:\> Get-ClusterResource "Disk X:" | Get-ClusterParameter

Object                        Name                          Value                         Type
------                        ----                          -----                         ----
Disk X:                       DiskIdType                    0                             UInt32
Disk X:                       DiskSignature                 0xB6F579CA                    UInt32
Disk X:                       DiskIdGuid                                                  String
Disk X:                       DiskRunChkDsk                 0                             UInt32
Disk X:                       DiskUniqueIds                 {16, 0, 0, 0...}              ByteArray
Disk X:                       DiskVolumeInfo                {1, 0, 0, 0...}               ByteArray
Disk X:                       DiskArbInterval               3                             UInt32
Disk X:                       DiskPath                                                    String
Disk X:                       DiskReload                    0                             UInt32
Disk X:                       MaintenanceMode               0                             UInt32
Disk X:                       MaxIoLatency                  1000                          UInt32
Disk X:                       CsvEnforceWriteThrough        0                             UInt32
Disk X:                       DiskPnpUpdate                 {0, 0, 0, 0...}               ByteArray

Much like using the DiskPath value with cluster.exe, the cluster identifies the mount point specified in the DiskPath property value and then updates the cluster disk resource properties.

As this is PowerShell, we can combine the creation of the resource, setting of the private properties and the online of the resource all in one big, ugly command:

PS C:\> Add-ClusterResource -Name "Disk X:" -ResourceType "Physical Disk" -Group "Available Storage" |Set-ClusterParameter DiskPath "X:" ; Start-ClusterResource "Disk X:"

Name                          State                         Group                         ResourceType
----                          -----                         -----                         ------------
Disk X:                       Online                        Available Storage             Physical Disk

If you want more info on other available PowerShell commands for use with Failover clustering, I'd recommend reviewing this article which maps cluster.exe commands to their equivalent PowerShell commands.

Posted by John Toner | with no comments

Error handling in a NativeActivity

Note: This blog post is written using the .NET framework 4.0 RC 1

Using Workflow Foundation 4 the NativeActivity is the powerhouse when it comes to building native activities. One of its many capabilities is around error handling. Every so often I run into one of these things where things don’t quite work the way I expect them to and this is one of these cases.

 

The basics of error handling when scheduling child activities.

Whenever a NativeActivity is executed it is passed an instance of the NativeActivityContext which it can use to schedule other activities using the ScheduleActivity() function. This ScheduleActivity() function has a few overloads, one of them using an FaultCallback. This FaultCallback is called when some kind of exception occurs while executing the child activity being scheduled. The fault handling function is called with a couple of parameters including a NativeActivityFaultContext and the exception that is unhandled. The NativeActivityFaultContext contains a HandleFault() function used to indicate that the fault was handled. Not quite as straightforward as a try/catch block but given the asynchronous nature of workflow that would not work.

So I expected the following activity to catch any exceptions and continue.

 

public sealed class MyActivity : NativeActivity
{
    public Activity Body { get; set; }
 
    protected override void Execute(NativeActivityContext context)
    {
        context.ScheduleActivity(Body, FaultHandler);
    }
 
    private void FaultHandler(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
    {
        Console.WriteLine(propagatedException.Message);
        faultContext.HandleFault();
    }
}
 

Do not use, this code has a serious error!

 

Lets test this code by executing the following workflow:

private static Activity CreateWorkflow()
{
    return new Sequence
    {
        Activities =
        {
            new WriteLine { Text = "Start outer sequence." },
            new MyActivity 
            {
                Body = new Sequence
                {
                    Activities = 
                    {
                        new WriteLine { Text = "Start inner sequence." },
                        new Throw { Exception = new InArgument<Exception>(ctx => new DivideByZeroException()) },
                        new WriteLine { Text = "End inner sequence." }
                    }
                }
            },
            new WriteLine { Text = "End outer sequence." }
        }
    };
}

 

Given this workflow I would expect the following output:

image

 

However what really happens is something else as I receive the following output:

image

As we can see the second inner WriteLine still executes even though the exception is caught at a higher level!

 

This behavior reminds me of the infamous VB6 On Error Resume Next where an error would just be ignored and the next statement executed. Not really what I was expecting or want.

So the fix is easy. All that is needed is to explicitly cancel the child activity being executed using the CancelChild() function. Below the correct version of my NativeActivity.

public sealed class MyActivity : NativeActivity
{
    public Activity Body { get; set; }
 
    protected override void Execute(NativeActivityContext context)
    {
        context.ScheduleActivity(Body, FaultHandler);
    }
 
    private void FaultHandler(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
    {
        Console.WriteLine(propagatedException.Message);
        faultContext.HandleFault();
        faultContext.CancelChild(propagatedFrom);
    }
}

The correct fault handler

 

Enjoy!

www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu

Posted by Maurice | with no comments
Filed under: , , , ,

End of the line

Windows 7 RC users will get notification around Feb 15th that usage of the RC will come to an end.. Details here..

http://windowsteamblog.com/blogs/windows7/archive/2010/02/01/important-reminder-regarding-expiration-of-the-windows-7-rc.aspx

Users of Windows 2000 should also be aware that support is coming to a very definite end. Without security updates of any kind, it will be increasingly difficult to maintain any level of safety if the computer is connected to the Internet for any length of time.

Posted by Mike Hall | with no comments
Filed under: ,

{Activa} tu conocimiento - Workshop Desarrollo para Windows 7.

9 de febrero 2010
16 de febrero 2010
23 de febrero 2010
2 de marzo 2010

 

Durante los martes del mes de febrero (o sea desde hoy) vamos a dictar un ciclo de talleres orientados a desarrollar aplicaciones cliente que sean compatibles y exploten todas las ventajas de la plataforma Microsoft Windows 7®.

Para este fin vamos a basarnos en el "Windows 7 Training Kit For Developers" el cual pueden descargar aquí.

Pueden asistir de forma presencial en las instalaciones de Microsoft Bogotá, o pueden asistir de forma virtual. Para inscribirse y conocer los demás temas de logística, lo pueden hacer a través del portal de {Activa} Colombia, aquí.

Los espero!!!.

Posted by Jaimir Guerrero | with no comments
Filed under: , ,
More Posts Next page »