<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9335777</id><updated>2011-11-28T07:56:52.224+08:00</updated><category term='code'/><category term='Android'/><title type='text'>Eddie's Tech Notes </title><subtitle type='html'>Tips, tricks and techniques for geeks of PHP, ASP, JSP, VB, .NET, JavaScript, Dreamweaver, MySQL, Oracle, SQL Server, etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9335777.post-5009410297273147410</id><published>2011-09-04T11:25:00.002+08:00</published><updated>2011-09-04T11:32:47.855+08:00</updated><title type='text'>jQuery UI Datepicker 1.8.16  民國年 Extender</title><content type='html'>&lt;pre style="font-family:Consolas;font-size:13;color:black;background:white;"&gt;&lt;code&gt;&lt;br /&gt;jQuery UI Datepicker 1.8.16  民國年 Extender&lt;br /&gt;&lt;br /&gt;&lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt;&lt;br /&gt;&lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Code Snippet&lt;/div&gt;&lt;br /&gt;&lt;div style="background: #fff; max-height: 300px; overflow: auto"&gt;&lt;br /&gt;&lt;ol start="1" style="background: #ffffff; margin: 0; padding: 0 0 0 5px;"&gt;&lt;br /&gt;&lt;li&gt;/*&lt;br /&gt;* jQuery UI Datepicker 1.8.16&lt;br /&gt;* Taiwan's Minguo calendar extender&lt;br /&gt;* This extender modified the year to Taiwan's Minguo calendar&lt;br /&gt;* Extended by Eddie Chen&lt;/li&gt;&lt;li&gt;*/&lt;br /&gt;&lt;/li&gt;&lt;li&gt;$.extend($.datepicker,{&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#006400;"&gt;/* Parse existing date and initialise date picker. */&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;    _setDateFromField: &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(inst, noDefault) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (inst.input.val() == inst.lastVal) {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; dateFormat = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'dateFormat'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; dates = inst.lastVal = inst.input ? inst.input.val() : &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; date, defaultDate;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        date = defaultDate = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._getDefaultDate(inst);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; settings = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._getFormatConfig(inst);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt; {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#006400;"&gt;//date = this.parseDate(dateFormat, dates, settings) || defaultDate;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(dates.couny&amp;gt;0)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; dateArr = dates.split(&lt;span style="color:#800000;"&gt;"/"&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; year = parseInt(dateArr[0], 10) + 1911;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; month = parseInt(dateArr[1], 10);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; day = parseInt(dateArr[2], 10);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            date = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Date(year, month, day);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        } &lt;span style="color:#0000ff;"&gt;catch&lt;/span&gt; (event) {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.log(event);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            dates = (noDefault ? &lt;span style="color:#800000;"&gt;''&lt;/span&gt; : dates);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        inst.selectedDay = date.getDate();&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        inst.drawMonth = inst.selectedMonth = date.getMonth();&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        inst.drawYear = date.getFullYear();&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        inst.selectedYear = date.getFullYear();&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        inst.currentDay = (dates ? date.getDate() : 0);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        inst.currentMonth = (dates ? date.getMonth() : 0);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        inst.currentYear = (dates ? date.getFullYear() : 0);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._adjustInstDate(inst);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;    },&lt;/li&gt;&lt;br /&gt;&lt;li&gt;_daylightSavingAdjust: &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(date) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!date) &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        date.setHours(date.getHours() &amp;gt; 12 ? date.getHours() + 2 : 0);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!date) &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;((date.getFullYear()-1911)&amp;gt;0)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            date.getFullYear((date.getFullYear()-1911));&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            date.getFullYear((date.getFullYear()));&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; date;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;    },&lt;/li&gt;&lt;br /&gt;&lt;li&gt;_taiwanDateAdjust: &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(date) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!date) &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;((date.getFullYear()-1911)&amp;gt;0)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            date.setFullYear((date.getFullYear()-1911),date.getMonth(),date.getDay());&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            date.setFullYear((date.getFullYear()),date.getMonth(),date.getDay());    &lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; date;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;    },&lt;/li&gt;&lt;br /&gt;&lt;li&gt;    &lt;span style="color:#006400;"&gt;/* Generate the month and year header. */&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;    _generateMonthYearHeader: &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(inst, drawMonth, drawYear, minDate, maxDate,&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            secondary, monthNames, monthNamesShort) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; changeMonth = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'changeMonth'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; changeYear = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'changeYear'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; showMonthAfterYear = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'showMonthAfterYear'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; html = &lt;span style="color:#800000;"&gt;'&amp;lt;div class="ui-datepicker-title"&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; monthHtml = &lt;span style="color:#800000;"&gt;''&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#006400;"&gt;// month selection&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (secondary || !changeMonth)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            monthHtml += &lt;span style="color:#800000;"&gt;'&amp;lt;span class="ui-datepicker-month"&amp;gt;'&lt;/span&gt; + monthNames[drawMonth] + &lt;span style="color:#800000;"&gt;'&amp;lt;/span&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; inMinYear = (minDate &amp;amp;&amp;amp; minDate.getFullYear() == drawYear);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; inMaxYear = (maxDate &amp;amp;&amp;amp; maxDate.getFullYear() == drawYear);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            monthHtml += &lt;span style="color:#800000;"&gt;'&amp;lt;select class="ui-datepicker-month" '&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#800000;"&gt;'onchange="DP_jQuery_'&lt;/span&gt; + dpuuid + &lt;span style="color:#800000;"&gt;'.datepicker._selectMonthYear(\'#'&lt;/span&gt; + inst.id + &lt;span style="color:#800000;"&gt;'\', this, \'M\');" '&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#800000;"&gt;'&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; month = 0; month &amp;lt; 12; month++) {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; ((!inMinYear || month &amp;gt;= minDate.getMonth()) &amp;amp;&amp;amp;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                        (!inMaxYear || month &amp;lt;= maxDate.getMonth()))&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    monthHtml += &lt;span style="color:#800000;"&gt;'&amp;lt;option value="'&lt;/span&gt; + month + &lt;span style="color:#800000;"&gt;'"'&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                        (month == drawMonth ? &lt;span style="color:#800000;"&gt;' selected="selected"'&lt;/span&gt; : &lt;span style="color:#800000;"&gt;''&lt;/span&gt;) +&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                        &lt;span style="color:#800000;"&gt;'&amp;gt;'&lt;/span&gt; + monthNamesShort[month] + &lt;span style="color:#800000;"&gt;'&amp;lt;/option&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            monthHtml += &lt;span style="color:#800000;"&gt;'&amp;lt;/select&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!showMonthAfterYear)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            html += monthHtml + (secondary || !(changeMonth &amp;amp;&amp;amp; changeYear) ? &lt;span style="color:#800000;"&gt;'&amp;amp;#xa0;'&lt;/span&gt; : &lt;span style="color:#800000;"&gt;''&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#006400;"&gt;// year selection&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; ( !inst.yearshtml ) {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            inst.yearshtml = &lt;span style="color:#800000;"&gt;''&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (secondary || !changeYear)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;((drawYear-1911) &amp;gt;0)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                    html += &lt;span style="color:#800000;"&gt;'&amp;lt;span class="ui-datepicker-year"&amp;gt;'&lt;/span&gt; + (drawYear-1911) + &lt;span style="color:#800000;"&gt;'&amp;lt;/span&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                    html += &lt;span style="color:#800000;"&gt;'&amp;lt;span class="ui-datepicker-year"&amp;gt;'&lt;/span&gt; + drawYear + &lt;span style="color:#800000;"&gt;'&amp;lt;/span&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#006400;"&gt;// determine range of years to display&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; years = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'yearRange'&lt;/span&gt;).split(&lt;span style="color:#800000;"&gt;':'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; thisYear = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Date().getFullYear();&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; determineYear = &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(value) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                        (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                        parseInt(value, 10)));&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (isNaN(year) ? thisYear : year);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                };&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; year = determineYear(years[0]);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; endYear = Math.max(year, determineYear(years[1] || &lt;span style="color:#800000;"&gt;''&lt;/span&gt;));&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                year = (minDate ? Math.max(year, minDate.getFullYear()) : year);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                inst.yearshtml += &lt;span style="color:#800000;"&gt;'&amp;lt;select class="ui-datepicker-year" '&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#800000;"&gt;'onchange="DP_jQuery_'&lt;/span&gt; + dpuuid + &lt;span style="color:#800000;"&gt;'.datepicker._selectMonthYear(\'#'&lt;/span&gt; + inst.id + &lt;span style="color:#800000;"&gt;'\', this, \'Y\');" '&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    &lt;span style="color:#800000;"&gt;'&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                    &lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;((drawYear-1911) &amp;gt;0)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (; year &amp;lt;= endYear; year++) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                        inst.yearshtml += &lt;span style="color:#800000;"&gt;'&amp;lt;option value="'&lt;/span&gt; + year + &lt;span style="color:#800000;"&gt;'"'&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                            (year == drawYear ? &lt;span style="color:#800000;"&gt;' selected="selected"'&lt;/span&gt; : &lt;span style="color:#800000;"&gt;''&lt;/span&gt;) +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                            &lt;span style="color:#800000;"&gt;'&amp;gt;'&lt;/span&gt; + (year-1911) + &lt;span style="color:#800000;"&gt;'&amp;lt;/option&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    }                &lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                {&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (; year &amp;lt;= endYear; year++) {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                        inst.yearshtml += &lt;span style="color:#800000;"&gt;'&amp;lt;option value="'&lt;/span&gt; + year + &lt;span style="color:#800000;"&gt;'"'&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                            (year == drawYear ? &lt;span style="color:#800000;"&gt;' selected="selected"'&lt;/span&gt; : &lt;span style="color:#800000;"&gt;''&lt;/span&gt;) +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                            &lt;span style="color:#800000;"&gt;'&amp;gt;'&lt;/span&gt; + (year) + &lt;span style="color:#800000;"&gt;'&amp;lt;/option&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                    }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;                inst.yearshtml += &lt;span style="color:#800000;"&gt;'&amp;lt;/select&amp;gt;'&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                &lt;/li&gt;&lt;br /&gt;&lt;li&gt;                html += inst.yearshtml;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;                inst.yearshtml = &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        html += &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._get(inst, &lt;span style="color:#800000;"&gt;'yearSuffix'&lt;/span&gt;);&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (showMonthAfterYear)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;            html += (secondary || !(changeMonth &amp;amp;&amp;amp; changeYear) ? &lt;span style="color:#800000;"&gt;'&amp;amp;#xa0;'&lt;/span&gt; : &lt;span style="color:#800000;"&gt;''&lt;/span&gt;) + monthHtml;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;        html += &lt;span style="color:#800000;"&gt;'&amp;lt;/div&amp;gt;'&lt;/span&gt;; &lt;span style="color:#006400;"&gt;// Close datepicker_header&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; html;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;    },&lt;/li&gt;&lt;br /&gt;&lt;li&gt;_formatDate : &lt;span style="color:#0000ff;"&gt;function&lt;/span&gt;(inst, day, month, year)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;    {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;       &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!day)&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;       {&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;           inst.currentDay = inst.selectedDay;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;           inst.currentMonth = inst.selectedMonth;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;           inst.currentYear = inst.selectedYear;&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;       }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;       &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; date = (day ? (&lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt; day == &lt;span style="color:#800000;"&gt;'object'&lt;/span&gt; ? day :&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;               &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._daylightSavingAdjust(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Date(year, month, day))) :&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;              &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._daylightSavingAdjust(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Date(inst.currentYear, inst.currentMonth, inst.currentDay)));&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;       &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (date.getFullYear() - 1911) + &lt;span style="color:#800000;"&gt;"/"&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;              (date.getMonth() &amp;lt; 9 ? &lt;span style="color:#800000;"&gt;"0"&lt;/span&gt; + (date.getMonth() + 1) : (date.getMonth() + 1)) + &lt;span style="color:#800000;"&gt;"/"&lt;/span&gt; +&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;              (date.getDate() &amp;lt; 10 ? &lt;span style="color:#800000;"&gt;"0"&lt;/span&gt; + date.getDate() : date.getDate());&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;    }&lt;/li&gt;&lt;br /&gt;&lt;li style="background: #f3f3f3"&gt;});&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-5009410297273147410?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/5009410297273147410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=5009410297273147410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/5009410297273147410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/5009410297273147410'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2011/09/jquery-ui-datepicker-1816-extender.html' title='jQuery UI Datepicker 1.8.16  民國年 Extender'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-6603927074563564317</id><published>2011-08-27T14:26:00.001+08:00</published><updated>2011-08-27T14:26:20.544+08:00</updated><title type='text'>How to prevent seeing “\ No newline at end of file” when using Git with Visual Studio</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1. In Visual Studio menu, select Tools &amp;gt; Macros &amp;gt; Macros IDE&lt;/p&gt;  &lt;p&gt;2. Select the Class View tab. Under My Macros, double click the EnvironmentEvents node. &lt;/p&gt;  &lt;p&gt;3. select DocumentEvents from the dropdown list on the left, then select DocumentSaved from the dropdown list on the right. This will generate a blank event handler.&lt;/p&gt;  &lt;p&gt;4. Paste the following code into the blank&amp;#160; event handler.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Private Sub DocumentEvents_DocumentSaved(ByVal Document As EnvDTE.Document) Handles DocumentEvents.DocumentSaved     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; '      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ' This handler will add a newline to end of file if it doesn't already have one.      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; '      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim textSelection As EnvDTE.TextSelection&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim originalLine As Integer     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; originalLine = textSelection.AnchorPoint.Line      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim originalOffset As Integer      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; originalOffset = textSelection.AnchorPoint.LineCharOffset      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim viewTop As EnvDTE.TextPoint      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; viewTop = textSelection.TextPane.StartPoint&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection.EndOfDocument(False)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim pt As VirtualPoint      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pt = textSelection.BottomPoint()&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection.GotoLine(pt.Line, True)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If textSelection.Text.Length &amp;lt;&amp;gt; 0 Then      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection.Text = textSelection.Text &amp;amp; vbCrLf      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DTE.ActiveDocument.Save()      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection.MoveToLineAndOffset(originalLine, originalOffset, False)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; textSelection.TextPane.TryToShow(viewTop, vsPaneShowHow.vsPaneShowTop)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Sub&lt;/p&gt;    &lt;p&gt;5. Save the macro&lt;/p&gt;    &lt;p&gt;From now on all the files saved through Visual Studio will be appended with a new line to avoid the error message in the Git source control.&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-6603927074563564317?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/6603927074563564317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=6603927074563564317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6603927074563564317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6603927074563564317'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2011/08/how-to-prevent-seeing-no-newline-at-end.html' title='How to prevent seeing “\ No newline at end of file” when using Git with Visual Studio'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-6900978784472618118</id><published>2011-02-20T20:52:00.001+08:00</published><updated>2011-02-20T20:52:52.644+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android Development Study Notes 2 - Opiton Menus</title><content type='html'>&lt;p&gt;&lt;b&gt;strings.xml&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&amp;lt;?xml version=&lt;i&gt;&amp;quot;1.0&amp;quot;&lt;/i&gt; encoding=&lt;i&gt;&amp;quot;utf-8&amp;quot;&lt;/i&gt;?&amp;gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;resources&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;string name=&lt;i&gt;&amp;quot;AllDepartment&amp;quot;&lt;/i&gt;&amp;gt;List All Depts&amp;lt;/string&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;string name=&lt;i&gt;&amp;quot;Seach&amp;quot;&lt;/i&gt;&amp;gt;Search&amp;lt;/string&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/resources&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Add the following codes in the activity class&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;     &lt;br /&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;@Override&lt;/p&gt;  &lt;p&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;boolean&lt;/b&gt; onCreateOptionsMenu(Menu menu) {&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; menu.add(0, 0, 0,&lt;b&gt;this&lt;/b&gt;.getResources().getString(R.string.&lt;i&gt;AllDepartment&lt;/i&gt;));&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; menu.add(0, 1, 1, &lt;b&gt;this&lt;/b&gt;.getResources().getString(R.string.&lt;i&gt;Seach&lt;/i&gt;));&lt;/p&gt;  &lt;p&gt;&lt;b&gt;return&lt;/b&gt; &lt;b&gt;super&lt;/b&gt;.onCreateOptionsMenu(menu);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;When user click on &amp;quot;menu&amp;quot; button, 2 option menus would appear at the bottom of the screen.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-6900978784472618118?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/6900978784472618118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=6900978784472618118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6900978784472618118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6900978784472618118'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2011/02/android-development-study-notes-2.html' title='Android Development Study Notes 2 - Opiton Menus'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-863167638833216505</id><published>2011-02-20T20:45:00.001+08:00</published><updated>2011-02-20T20:45:49.366+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android Study Notes 1  - "Hello World"</title><content type='html'>&lt;p&gt;&amp;quot;Hello World&amp;quot;&lt;/p&gt;  &lt;p&gt;strings.xml&lt;/p&gt;  &lt;p&gt;&amp;lt;?xml version=&lt;i&gt;&amp;quot;1.0&amp;quot;&lt;/i&gt; encoding=&lt;i&gt;&amp;quot;utf-8&amp;quot;&lt;/i&gt;?&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;resources&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;string name=&lt;i&gt;&amp;quot;hello&amp;quot;&lt;/i&gt;&amp;gt;Hello World, DroidActivity!&amp;lt;/string&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;string name=&lt;i&gt;&amp;quot;app_name&amp;quot;&lt;/i&gt;&amp;gt;Droid1&amp;lt;/string&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;string name=&lt;i&gt;&amp;quot;hello1&amp;quot;&lt;/i&gt;&amp;gt;你好!&amp;lt;/string&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/resources&amp;gt;&lt;/p&gt;  &lt;p&gt;main.xml&lt;/p&gt;  &lt;p&gt;&amp;lt;?xml version=&lt;i&gt;&amp;quot;1.0&amp;quot;&lt;/i&gt; encoding=&lt;i&gt;&amp;quot;utf-8&amp;quot;&lt;/i&gt;?&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;LinearLayout xmlns:android=&lt;i&gt;&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;android:orientation=&lt;i&gt;&amp;quot;vertical&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;android:layout_width=&lt;i&gt;&amp;quot;fill_parent&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;android:layout_height=&lt;i&gt;&amp;quot;fill_parent&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;TextView&lt;/p&gt;  &lt;p&gt;android:layout_width=&lt;i&gt;&amp;quot;fill_parent&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;android:layout_height=&lt;i&gt;&amp;quot;wrap_content&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;android:text=&lt;i&gt;&amp;quot;@string/hello&amp;quot;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;/&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;TextView android:id=&lt;i&gt;&amp;quot;@+id/textView1&amp;quot;&lt;/i&gt;android:layout_width=&lt;i&gt;&amp;quot;wrap_content&amp;quot;&lt;/i&gt; android:layout_height=&lt;i&gt;&amp;quot;wrap_content&amp;quot;&lt;/i&gt;android:text=&lt;i&gt;&amp;quot;@string/hello1&amp;quot;&lt;/i&gt;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/p&gt;  &lt;p&gt;DroidAvtivity.java&lt;/p&gt;  &lt;p&gt;package com.myandroid.droid1;   &lt;br /&gt;import android.app.Activity;    &lt;br /&gt;import android.os.Bundle;    &lt;br /&gt;public class DroidActivity extends Activity {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; /** Called when the activity is first created. */    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; @Override    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public void onCreate(Bundle savedInstanceState) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; super.onCreate(savedInstanceState);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; setContentView(R.layout.main);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;}&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-863167638833216505?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/863167638833216505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=863167638833216505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/863167638833216505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/863167638833216505'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2011/02/android-study-notes-1-world.html' title='Android Study Notes 1  - &amp;quot;Hello World&amp;quot;'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-4239307848709631596</id><published>2010-11-10T11:29:00.002+08:00</published><updated>2010-11-10T11:32:51.293+08:00</updated><title type='text'>Validation of viewstate MAC failed</title><content type='html'>Error message:&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: medium; color: rgb(70, 82, 91); "&gt;&lt;b&gt;&lt;span &gt;Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machinekey&gt; configuration specifies the same validationKey &amp;amp; validation algorithm. AutoGenerate cannot be used in a cluster.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(70, 82, 91); font-weight: normal; font-size: 13px; "&gt;Solution: &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(70, 82, 91); font-weight: normal; font-size: 13px; "&gt;Disable viewstate change by adding this to the affected aspx page.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; color: rgb(70, 82, 91); "&gt;EnableViewState="false" EnableEventValidation="false" enableViewStateMac=false&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; color: rgb(70, 82, 91); "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; color: rgb(70, 82, 91); "&gt;For example:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   &gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="myLogin" EnableViewState="false" EnableEventValidation="false" enableViewStateMac=false %&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-4239307848709631596?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/4239307848709631596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=4239307848709631596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4239307848709631596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4239307848709631596'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2010/11/validation-of-viewstate-mac-failed.html' title='Validation of viewstate MAC failed'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-1427522816620924743</id><published>2010-11-10T11:25:00.003+08:00</published><updated>2010-11-10T11:29:05.937+08:00</updated><title type='text'>Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: rgb(51, 51, 51); line-height: 18px; "&gt;Today I encountered this weird error after I published my ASP.NET to the server.&lt;br /&gt;&lt;table class="contentpaneopen" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; width: 911px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="contentheading" width="100%" style="font-size: 19px; font-family: 'Segoe UI', Arial, Helvetica, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-weight: bold; "&gt;Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   &gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 18px;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   &gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 18px;"&gt;1. In login.aspx.cs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   &gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 18px;"&gt;Change &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 12px; border-collapse: collapse; line-height: 13px; "&gt;&lt;code class="keyword" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 102, 153) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;public&lt;/code&gt; &lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;partial &lt;/code&gt;&lt;code class="keyword" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 102, 153) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;class&lt;/code&gt; &lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;Login : System.Web.UI.Page to &lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 12px; border-collapse: collapse; line-height: 13px; "&gt;&lt;code class="keyword" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 102, 153) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;public&lt;/code&gt; &lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;partial &lt;/code&gt;&lt;code class="keyword" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 102, 153) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;class&lt;/code&gt; &lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;myLogin : System.Web.UI.Page&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 12px; border-collapse: collapse; line-height: 13px; "&gt;&lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 12px; border-collapse: collapse; line-height: 13px; "&gt;&lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;2. In login.aspx&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 12px; border-collapse: collapse; line-height: 13px; "&gt;&lt;code class="plain" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-family: Consolas, Monaco, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; display: inline !important; color: rgb(0, 0, 0) !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;Change &lt;/code&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; white-space: pre; "&gt;&lt;%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; white-space: pre; "&gt;  CodeFile="Login.aspx.cs" Inherits="&lt;strong&gt;&lt;span &gt;Login&lt;/span&gt;&lt;/strong&gt;" %&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; white-space: pre; "&gt;to &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; white-space: pre; "&gt;&lt;%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; white-space: pre; "&gt;CodeFile="Login.aspx.cs" Inherits="&lt;strong&gt;&lt;span &gt;myLogin&lt;/span&gt;&lt;/strong&gt;" %&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-1427522816620924743?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/1427522816620924743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=1427522816620924743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1427522816620924743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1427522816620924743'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2010/11/cannot-convert-type-asploginaspx-to.html' title='Cannot convert type ASP.login_aspx to System.Web.UI.WebControls.Login'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-572596342860453280</id><published>2010-06-07T14:08:00.001+08:00</published><updated>2010-06-07T14:08:38.839+08:00</updated><title type='text'>SQL script to get table metadata form a SQL server</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; "&gt;// SQL script to get table metadata form a SQL server&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;SELECT     u.name + '.' + t.name AS [table], c.name AS [column]&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;FROM         sys.sysobjects AS t INNER JOIN&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;                      sys.sysusers AS u ON u.uid = t.uid LEFT OUTER JOIN&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;                      sys.extended_properties AS td ON td.major_id = t.id AND td.minor_id = 0 AND td.name = 'MS_Description' INNER JOIN&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;                      sys.syscolumns AS c ON c.id = t.id LEFT OUTER JOIN&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;                      sys.extended_properties AS cd ON cd.major_id = c.id AND cd.minor_id = c.colid AND cd.name = 'MS_Description'&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;WHERE     (t.type = 'u')&lt;/div&gt;&lt;div style="margin-top: 0px; margin-bottom: 0px; "&gt;ORDER BY t.name, c.colorder&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-572596342860453280?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/572596342860453280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=572596342860453280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/572596342860453280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/572596342860453280'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2010/06/sql-script-to-get-table-metadata-form.html' title='SQL script to get table metadata form a SQL server'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-61214025985132172</id><published>2009-12-01T09:21:00.000+08:00</published><updated>2009-12-01T09:22:00.081+08:00</updated><title type='text'>To disable right click event in JavaScript using jQuery</title><content type='html'>&lt;pre&gt;$(&lt;span style="color: blue;"&gt;function&lt;/span&gt;() {&lt;br /&gt;           $(&lt;span style="color: blue;"&gt;this&lt;/span&gt;).bind(&lt;span style="color: rgb(163, 21, 21);"&gt;"contextmenu"&lt;/span&gt;, &lt;span style="color: blue;"&gt;function&lt;/span&gt;(e) {&lt;br /&gt;               e.preventDefault();&lt;br /&gt;           });&lt;br /&gt;       }); &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-61214025985132172?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/61214025985132172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=61214025985132172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/61214025985132172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/61214025985132172'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/12/to-disable-right-click-event-in.html' title='To disable right click event in JavaScript using jQuery'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-7251502425228346920</id><published>2009-08-07T20:36:00.001+08:00</published><updated>2009-08-07T20:47:15.877+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='code'/><title type='text'>WF Activity to send a plurk message</title><content type='html'>&lt;!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset136\fprq1 &amp;#32048;&amp;#26126;&amp;#39636;;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;\red0\green128\blue0;}??\fs18 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.ComponentModel;\par ??\cf1 using\cf0  System.Workflow.Activities;\par ??\cf1 using\cf0  System.Workflow.ComponentModel;\par ??\par ??\cf1 namespace\cf0  SendPlurkMessageActivity\par ??\{\par ??\tab \cf1 public\cf0  \cf1 partial\cf0  \cf1 class\cf0  \cf4 SendPlurkMessageActivity\cf0 : \cf4 SequenceActivity\par ??\cf0 \tab \{\par ??\tab \tab \cf1 public\cf0  SendPlurkMessageActivity()\par ??\tab \tab \{\par ??\tab \tab \tab InitializeComponent();\par ??        \}\par ??\cf1         #region\cf0  Public workflow members\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  PlurkUserNameProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "PlurkUserName"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendPlurkMessageActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "PlurkUserName"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "PlurkUserName Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  PlurkUserName\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkUserNameProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkUserNameProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  PlurkPasswordProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "PlurkPassword"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendPlurkMessageActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "PlurkPassword"\cf0 )] \par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "PlurkPassword Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  PlurkPassword\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkPasswordProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkPasswordProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  PlurkMessageBodyProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "PlurkMessageBody"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendPlurkMessageActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "PlurkMessageBody"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "PlurkMessageBody Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  PlurkMessageBody\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkMessageBodyProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendPlurkMessageActivity\cf0 .PlurkMessageBodyProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??\cf1         #endregion\par ??\par ??\cf0         \cf1 protected\cf0  \cf1 override\cf0  \cf4 ActivityExecutionStatus\cf0  Execute(\cf4 ActivityExecutionContext\cf0  executionContext)\par ??        \{\par ??            \cf1 try\par ??\cf0             \{\par ??                PlurkApi.\cf4 PlurkApi\cf0  api = \cf1 new\cf0  PlurkApi.\cf4 PlurkApi\cf0 ();\par ??                \cf1 if\cf0  (api.Login(PlurkUserName, PlurkPassword))\par ??                \{\par ??                    api.addMessage(\cf5 "tr_ch"\cf0 , \cf1 string\cf0 .Empty, PlurkMessageBody, \cf1 true\cf0 , \cf1 string\cf0 .Empty);\par ??                    \cf6 //api.\par ??\cf0                     \cf6 //api.addMessage("tr_ch", string.Empty, "Plurking from WWF C# CustomizedAction. Current Taiwan time is " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString(), true, string.Empty);\par ??\cf0                 \}\par ??\par ??            \}\par ??            \cf1 catch\cf0  (\cf4 Exception\cf0  ex)\par ??            \{\par ??                \par ??            \}\par ??\par ??\par ??            \cf1 return\cf0  \cf4 ActivityExecutionStatus\cf0 .Closed;\par ??        \}\par ??    \par ??    \}\par ??\}\par ??} --&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:細明體;font-size:9pt;color:black;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.ComponentModel;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.Workflow.Activities;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.Workflow.ComponentModel;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;namespace&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SendPlurkMessageActivity&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;partial&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;class&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;: &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SequenceActivity&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SendPlurkMessageActivity()&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            InitializeComponent();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;        #region&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Public workflow members&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkUserNameProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkUserName"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkUserName"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkUserName Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkUserName&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkUserNameProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkUserNameProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkPasswordProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkPassword"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkPassword"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)] &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkPassword Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkPassword&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkPasswordProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkPasswordProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkMessageBodyProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkMessageBody"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkMessageBody"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"PlurkMessageBody Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkMessageBody&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkMessageBodyProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendPlurkMessageActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PlurkMessageBodyProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;        #endregion&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;protected&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;override&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionStatus&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Execute(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionContext&lt;/span&gt; executionContext)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;try&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                PlurkApi.&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;PlurkApi&lt;/span&gt;&lt;span style="font-size:100%;"&gt; api = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PlurkApi.&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;PlurkApi&lt;/span&gt;&lt;span style="font-size:100%;"&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;if&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (api.Login(PlurkUserName, PlurkPassword))&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                    api.addMessage(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"tr_ch"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Empty, PlurkMessageBody, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Empty);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                    &lt;/span&gt;&lt;span style=";font-size:100%;color:green;"  &gt;//api.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                    &lt;/span&gt;&lt;span style=";font-size:100%;color:green;"  &gt;//api.addMessage("tr_ch", string.Empty, "Plurking from WWF C# CustomizedAction. Current Taiwan time is " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString(), true, string.Empty);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;catch&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;Exception&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ex)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionStatus&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Closed;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-7251502425228346920?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/7251502425228346920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=7251502425228346920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7251502425228346920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7251502425228346920'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/08/wf-activity-to-send-plurk-message.html' title='WF Activity to send a plurk message'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-2429818885918280128</id><published>2009-08-06T23:06:00.004+08:00</published><updated>2009-08-06T23:14:21.435+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='code'/><title type='text'>SMTP SendMailActivity for Windows Workflow</title><content type='html'>&lt;!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset136\fprq1 &amp;#32048;&amp;#26126;&amp;#39636;;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red43\green145\blue175;\red163\green21\blue21;\red0\green128\blue0;}??\fs18 \cf1 using\cf0  System;\par ??\cf1 using\cf0  System.ComponentModel;\par ??\cf1 using\cf0  System.Net;\par ??\cf1 using\cf0  System.Net.Mail;\par ??\cf1 using\cf0  System.Workflow.ComponentModel;\par ??\par ??\cf1 namespace\cf0  SendMailActivity\par ??\{\par ??\tab \cf1 public\cf0  \cf1 partial\cf0  \cf1 class\cf0  \cf4 SendMailActivity\cf0 : \cf4 Activity\par ??\cf0 \tab \{\par ??\tab \tab \cf1 public\cf0  SendMailActivity()\par ??\tab \tab \{\par ??\tab \tab \tab InitializeComponent();\par ??\tab \tab \}        \par ??\par ??\cf1         #region\cf0  Public workflow members\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  FromProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "From"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "The email address of the sender"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Parameters"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  From\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .FromProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .FromProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??       \par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  ToProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "To"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "The email address of the receiver"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Parameters"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  To\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .ToProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .ToProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  SubjectProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Subject"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Subject"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Parameters"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  Subject\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .SubjectProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .SubjectProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  BodyProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Body"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Body"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Parameters"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  Body\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .BodyProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .BodyProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  HostProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Host"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Host"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Parameters"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  Host\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .HostProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .HostProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  LoginProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Login"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Login"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Login Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  Login\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .LoginProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .LoginProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  PasswordProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Password"\cf0 , \cf1 typeof\cf0 (\cf1 string\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Password"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Password Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 string\cf0  Password\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 string\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .PasswordProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .PasswordProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf4 DependencyProperty\cf0  PortProperty = \cf4 DependencyProperty\cf0 .Register(\cf5 "Port"\cf0 , \cf1 typeof\cf0 (\cf1 int\cf0 ), \cf1 typeof\cf0 (\cf4 SendMailActivity\cf0 ));\par ??\par ??        [\cf4 DescriptionAttribute\cf0 (\cf5 "Port"\cf0 )]\par ??        [\cf4 CategoryAttribute\cf0 (\cf5 "Port Category"\cf0 )]\par ??        [\cf4 BrowsableAttribute\cf0 (\cf1 true\cf0 )]\par ??        [\cf4 DesignerSerializationVisibilityAttribute\cf0 (\cf4 DesignerSerializationVisibility\cf0 .Visible)]\par ??        \cf1 public\cf0  \cf1 int\cf0  Port\par ??        \{\par ??            \cf1 get\par ??\cf0             \{\par ??                \cf1 return\cf0  ((\cf1 int\cf0 )(\cf1 base\cf0 .GetValue(\cf4 SendMailActivity\cf0 .PortProperty)));\par ??            \}\par ??            \cf1 set\par ??\cf0             \{\par ??                \cf1 base\cf0 .SetValue(\cf4 SendMailActivity\cf0 .PortProperty, \cf1 value\cf0 );\par ??            \}\par ??        \}\par ??\par ??\cf1         #endregion\par ??\par ??\cf0         \cf1 protected\cf0  \cf1 override\cf0  \cf4 ActivityExecutionStatus\cf0  Execute(\cf4 ActivityExecutionContext\cf0  executionContext)\par ??        \{\par ??            \cf1 try\par ??\cf0             \{\par ??                \cf4 MailAddress\cf0  toAddress = \cf1 new\cf0  \cf4 MailAddress\cf0 (To);\par ??                \cf4 MailAddress\cf0  fromAddress = \cf1 new\cf0  \cf4 MailAddress\cf0 (From);\par ??\par ??                \cf4 MailAddressCollection\cf0  addresses = \cf1 new\cf0  \cf4 MailAddressCollection\cf0 ();\par ??                addresses.Add(toAddress);\par ??\par ??                \cf4 MailMessage\cf0  msg = \cf1 new\cf0  \cf4 MailMessage\cf0 (fromAddress, toAddress);\par ??                msg.Subject = Subject;\par ??                msg.Body = Body;\par ??\par ??                \cf4 SmtpClient\cf0  mail = \cf1 new\cf0  \cf4 SmtpClient\cf0 (Host);\par ??                mail.Port = Port; \cf6 //587;\par ??\cf0                 mail.Credentials = \cf1 new\cf0  \cf4 NetworkCredential\cf0 (Login, Password);\par ??                mail.EnableSsl = \cf1 true\cf0 ;\par ??                mail.Send(msg);\par ??                \par ??            \}\par ??            \cf1 catch\cf0  (\cf4 Exception\cf0  ex)\par ??            \{\par ??                \cf4 Console\cf0 .WriteLine(ex.Message);\par ??            \}\par ??\par ??\par ??            \cf1 return\cf0  \cf4 ActivityExecutionStatus\cf0 .Closed;\par ??        \}\par ??\tab \}\par ??\par ??\par ??\}\par ??} --&gt;&lt;span style="font-family: arial;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial;font-family:細明體;font-size:9pt;color:black;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.ComponentModel;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.Net;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.Net.Mail;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;using&lt;/span&gt;&lt;span style="font-size:100%;"&gt; System.Workflow.ComponentModel;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;namespace&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SendMailActivity&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;partial&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;class&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;: &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;Activity&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SendMailActivity()&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            InitializeComponent();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }        &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;        #region&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Public workflow members&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; FromProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"From"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"The email address of the sender"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Parameters"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; From&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.FromProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.FromProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ToProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"To"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"The email address of the receiver"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Parameters"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; To&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.ToProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.ToProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; SubjectProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Subject"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Subject"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Parameters"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Subject&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SubjectProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SubjectProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; BodyProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Body"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Body"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Parameters"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Body&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.BodyProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.BodyProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; HostProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Host"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Host"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Parameters"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Host&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.HostProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.HostProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; LoginProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Login"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Login"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Login Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Login&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.LoginProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.LoginProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PasswordProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Password"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Password"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Password Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Password&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;string&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PasswordProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PasswordProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt; PortProperty = &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Register(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Port"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;int&lt;/span&gt;&lt;span style="font-size:100%;"&gt;), &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;typeof&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DescriptionAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Port"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;CategoryAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);font-size:100%;" &gt;"Port Category"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;BrowsableAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        [&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibilityAttribute&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;DesignerSerializationVisibility&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Visible)]&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;public&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;int&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Port&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ((&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;int&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)(&lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PortProperty)));&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;base&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SendMailActivity&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.PortProperty, &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;value&lt;/span&gt;&lt;span style="font-size:100%;"&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;        #endregion&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;protected&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;override&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionStatus&lt;/span&gt;&lt;span style="font-size:100%;"&gt; Execute(&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionContext&lt;/span&gt;&lt;span style="font-size:100%;"&gt; executionContext)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;try&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddress&lt;/span&gt;&lt;span style="font-size:100%;"&gt; toAddress = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddress&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(To);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddress&lt;/span&gt;&lt;span style="font-size:100%;"&gt; fromAddress = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddress&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(From);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddressCollection&lt;/span&gt;&lt;span style="font-size:100%;"&gt; addresses = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailAddressCollection&lt;/span&gt;&lt;span style="font-size:100%;"&gt;();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                addresses.Add(toAddress);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailMessage&lt;/span&gt;&lt;span style="font-size:100%;"&gt; msg = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;MailMessage&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(fromAddress, toAddress);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                msg.Subject = Subject;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                msg.Body = Body;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SmtpClient&lt;/span&gt;&lt;span style="font-size:100%;"&gt; mail = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;SmtpClient&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(Host);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                mail.Port = Port; &lt;/span&gt;&lt;span style=";font-size:100%;color:green;"  &gt;//587;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                mail.Credentials = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;new&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;NetworkCredential&lt;/span&gt;&lt;span style="font-size:100%;"&gt;(Login, Password);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                mail.EnableSsl = &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;true&lt;/span&gt;&lt;span style="font-size:100%;"&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                mail.Send(msg);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;catch&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;Exception&lt;/span&gt;&lt;span style="font-size:100%;"&gt; ex)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;                &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;Console&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.WriteLine(ex.Message);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;            &lt;/span&gt;&lt;span style=";font-size:100%;color:blue;"  &gt;return&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);font-size:100%;" &gt;ActivityExecutionStatus&lt;/span&gt;&lt;span style="font-size:100%;"&gt;.Closed;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;        }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;    }&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;// Gmail settings&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;// SMTP server: smtp.gmail.com&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;// Port: 587&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-2429818885918280128?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/2429818885918280128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=2429818885918280128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/2429818885918280128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/2429818885918280128'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/08/smtp-sendmailactivity-for-windows.html' title='SMTP SendMailActivity for Windows Workflow'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-4766272728519893027</id><published>2009-07-20T16:46:00.002+08:00</published><updated>2009-07-20T16:49:38.680+08:00</updated><title type='text'>How to view windows server's minidump file</title><content type='html'>1. Install &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx"&gt;Microsoft Debugging Tools&lt;/a&gt;&lt;br /&gt;2. Open command prompt&lt;br /&gt;3. type \program files\debugging tools\kd -z C:\WINDOWS\Minidump\*.dmp&lt;br /&gt;4. .logopen c:\test.txt&lt;br /&gt;5. &lt;span&gt;.sympath srv*c:\symbols*&lt;a href="http://msdl.microsoft.com/download/symbols" class="smarterwiki-linkify"&gt;http://msdl.microsoft.com/download/symbols&lt;/a&gt;&lt;br /&gt;6. &lt;/span&gt;.reload;!analyze -v;r;kv;lmnt;.logclose;q&lt;br /&gt;7. Now you can open c:\test.txt with notepad to view the content.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-4766272728519893027?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/4766272728519893027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=4766272728519893027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4766272728519893027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4766272728519893027'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/07/how-to-view-windows-servers-minidump.html' title='How to view windows server&apos;s minidump file'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-4989288322461065993</id><published>2009-06-07T21:03:00.001+08:00</published><updated>2009-06-07T21:03:29.304+08:00</updated><title type='text'>How to reset auto increment value in SQL server</title><content type='html'>DBCC CHECKIDENT ('tablename', RESEED, newseed)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-4989288322461065993?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/4989288322461065993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=4989288322461065993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4989288322461065993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/4989288322461065993'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/06/how-to-reset-auto-increment-value-in.html' title='How to reset auto increment value in SQL server'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-6950661133003510785</id><published>2009-06-06T21:36:00.001+08:00</published><updated>2009-06-06T21:36:44.137+08:00</updated><title type='text'></title><content type='html'>10 Must have free windows downloads.&lt;br /&gt;&lt;br /&gt;1. Google Chrome &lt;br /&gt;2. Google Picasa&lt;br /&gt;3. Google Earth&lt;br /&gt;4. Foxit Reader&lt;br /&gt;5. doPDF&lt;br /&gt;6. TeraCopy&lt;br /&gt;7. Revo Uninstaller&lt;br /&gt;8. UltraVNC&lt;br /&gt;9. Notepad++&lt;br /&gt;10. Digsby&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-6950661133003510785?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/6950661133003510785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=6950661133003510785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6950661133003510785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6950661133003510785'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/06/10-must-have-free-windows-downloads.html' title=''/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-512045611143335580</id><published>2009-05-01T15:20:00.001+08:00</published><updated>2009-05-01T15:22:15.798+08:00</updated><title type='text'>Useful  commands</title><content type='html'>conf - NetMeeting&lt;br /&gt;ipconfig - find out current IP address&lt;br /&gt;compmgmt.msc - Computer management&lt;br /&gt;devmgmt.msc - Device manager&lt;br /&gt;diskmgmt.msc - Disk management&lt;br /&gt;dfrg.msc - Disk defrag&lt;br /&gt;eventvwr.msc - Event viewer&lt;br /&gt;fsmgmt.msc - Shared folders&lt;br /&gt;gpedit.msc - Group policies&lt;br /&gt;lusrmgr.msc - Local users and groups&lt;br /&gt;perfmon.msc - Performance monitor&lt;br /&gt;rsop.msc - Resultant set of policies&lt;br /&gt;secpol.msc - Local security settings&lt;br /&gt;services.msc - Various Services&lt;br /&gt;msconfig - System Configuration Utility&lt;br /&gt;regedit - Registry Editor&lt;br /&gt;msinfo32 System Information&lt;br /&gt;sysedit System Edit&lt;br /&gt;win.ini - windows loading information(also system.ini)&lt;br /&gt;winver - Shows current version of windows&lt;br /&gt;mailto: - Opens default email client&lt;br /&gt;command - Opens command prompt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-512045611143335580?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/512045611143335580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=512045611143335580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/512045611143335580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/512045611143335580'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/05/useful-commands.html' title='Useful  commands'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-1059219993011862096</id><published>2009-05-01T08:56:00.003+08:00</published><updated>2009-06-09T22:43:59.216+08:00</updated><title type='text'>How to disable Autorun in Windows XP to prevent virus infection?</title><content type='html'>In Windows click "Start", then click "Run"&lt;br /&gt;&lt;br /&gt;Type "regedit" click "OK"&lt;br /&gt;Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom&lt;br /&gt;Change DWAORD value of "Autorun" to 0 (default is 1)&lt;br /&gt;Click OK.&lt;br /&gt;Reboot.&lt;fieldset class="zemanta-related"&gt;&lt;legend class="zemanta-related-title"&gt;Related articles by Zemanta&lt;/legend&gt;&lt;ul class="zemanta-article-ul"&gt;&lt;li class="zemanta-article-ul-li"&gt;&lt;a href="http://www.makeuseof.com/tag/how-to-prevent-a-usb-drive-from-running-anything-automatically-in-windows/"&gt; How To Prevent A USB Drive From Running Anything Automatically In Windows &lt;/a&gt; (makeuseof.com)&lt;/li&gt;&lt;/ul&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"&gt;&lt;a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/83902d18-24b1-428a-92bc-b53d4ae04f12/" title="Reblog this post [with Zemanta]"&gt;&lt;img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=83902d18-24b1-428a-92bc-b53d4ae04f12" alt="Reblog this post [with Zemanta]"&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"&gt;&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-1059219993011862096?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/1059219993011862096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=1059219993011862096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1059219993011862096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1059219993011862096'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/05/how-to-disable-autorun-in-windows-xp-to.html' title='How to disable Autorun in Windows XP to prevent virus infection?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-854846256930461457</id><published>2009-01-14T13:24:00.002+08:00</published><updated>2009-01-14T13:25:45.313+08:00</updated><title type='text'>How not to give a presentation?</title><content type='html'>I found a very interesting power point slides.&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px;text-align:left" id="__ss_85551"&gt;&lt;object style="margin:0px" height="355" width="425"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=death-by-powerpoint4344"/&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=death-by-powerpoint4344" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;&lt;a href="http://www.slideshare.net/?src=embed"&gt;&lt;img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare"/&gt;&lt;/a&gt; | &lt;a href="undefined" title="View this slideshow on SlideShare"&gt;View&lt;/a&gt; | &lt;a href="http://www.slideshare.net/upload"&gt;Upload your own&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-854846256930461457?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/854846256930461457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=854846256930461457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/854846256930461457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/854846256930461457'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2009/01/how-not-to-give-presentation.html' title='How not to give a presentation?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-900212366307055914</id><published>2008-11-11T14:14:00.000+08:00</published><updated>2008-11-11T14:19:34.060+08:00</updated><title type='text'>Key mapping for VMware under Ubuntu 8.10</title><content type='html'>Recently I have been playing Ubuntu 8.10 and found out a problem.&lt;br /&gt;When I installed a windows under VMware in Ubuntu, the key mapping was wrong.&lt;br /&gt;It will not let me use arrow, insert, delete, backspaces, etc.&lt;br /&gt;&lt;br /&gt;I have found out a solution.&lt;br /&gt;&lt;br /&gt;1. Go to Terminal&lt;br /&gt;2. Type gedit ~/.vmware/config&lt;br /&gt;3. In the config file, type "xkeymap.nokeycodeMap = true" without the quotes.&lt;br /&gt;&lt;br /&gt;Restard VMware and it would be fixed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-900212366307055914?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/900212366307055914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=900212366307055914' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/900212366307055914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/900212366307055914'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/11/key-mapping-for-vmware-under-ubuntu-810.html' title='Key mapping for VMware under Ubuntu 8.10'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-6382165739967688123</id><published>2008-10-01T15:32:00.000+08:00</published><updated>2008-10-01T15:34:50.409+08:00</updated><title type='text'>Biomedical Informatics Introduction Presentation @ Taipei Medical University</title><content type='html'>&lt;div&gt;This Friday, I will be the main presentor for the biomedical informatics class in Taipei Medical University. I hope everything will go smoothly.&lt;/div&gt;&lt;iframe src="http://docs.google.com/EmbedSlideshow?docid=ddvcg8vs_35dnqthmfq" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-6382165739967688123?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/6382165739967688123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=6382165739967688123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6382165739967688123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/6382165739967688123'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/10/biomedical-informatics-introduction.html' title='Biomedical Informatics Introduction Presentation @ Taipei Medical University'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-1349853066873828763</id><published>2008-09-16T12:04:00.000+08:00</published><updated>2008-09-16T12:09:59.652+08:00</updated><title type='text'>Screen Scraping made simple</title><content type='html'>&lt;div&gt;If you are using .NET, simply use the following function to get HTML string from an URL. &lt;/div&gt;&lt;div&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;public static string&lt;/span&gt; getHTML(&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt; url)&lt;br /&gt;    {&lt;br /&gt;     &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;return new&lt;/span&gt; System.Net.&lt;span class="Apple-style-span" style="color: rgb(102, 102, 204);"&gt;WebClient&lt;/span&gt;().DownloadString(url);&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-1349853066873828763?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/1349853066873828763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=1349853066873828763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1349853066873828763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/1349853066873828763'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/09/screen-scraping-made-simple.html' title='Screen Scraping made simple'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-7391251155224038936</id><published>2008-09-12T11:52:00.001+08:00</published><updated>2008-09-12T12:06:06.184+08:00</updated><title type='text'>Display ASP.NET's menu in Safari or Google's Chrome</title><content type='html'>&lt;div&gt;To fix the incorrect and ugly rendering of ASP.NET's menu component in Apple's Safari or Google's Chrome browsers. You need to do the following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Make sure you have admin privilages&lt;/div&gt;&lt;div&gt;2. Go to &lt;pre&gt;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;3. Open up mozilla.browser with notepad or any other text editor&lt;/div&gt;&lt;div&gt;4. Find this section &lt;/div&gt;&lt;div&gt;5. Delete enitre  section within  section &lt;/div&gt;&lt;div&gt;6. Under command prompt, run &lt;pre&gt;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regbrowsers.exe -i&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After the above steps, the rendering of an ASP.NET menu will be the same as it is rendered on IE.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-7391251155224038936?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/7391251155224038936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=7391251155224038936' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7391251155224038936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7391251155224038936'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/09/display-aspnets-menu-in-safari-or.html' title='Display ASP.NET&apos;s menu in Safari or Google&apos;s Chrome'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-3773667197751850835</id><published>2008-07-14T12:05:00.000+08:00</published><updated>2008-07-14T12:06:30.283+08:00</updated><title type='text'>KIS registry entries</title><content type='html'>&lt;p&gt;Free Access to KAV/KIS 6.0/7.0:&lt;/p&gt; &lt;p&gt;1.Shut down Kaspersky.&lt;/p&gt; &lt;p&gt;2.Run regedit, and remove the following registries. (Key Removal)&lt;/p&gt; &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\KasperskyLab\LicStorage&lt;/p&gt; &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG&lt;/p&gt; &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\SPC\Certificates&lt;/p&gt; &lt;p&gt;3.Run Kaspersky, choose 30-day trial key and activate.&lt;/p&gt; &lt;p&gt;4.When the 30-day trial key expired, run these steps again.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-3773667197751850835?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/3773667197751850835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=3773667197751850835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/3773667197751850835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/3773667197751850835'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/07/kis-registry-entries.html' title='KIS registry entries'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-7046500666902145118</id><published>2008-04-30T14:35:00.000+08:00</published><updated>2008-04-30T14:36:46.066+08:00</updated><title type='text'>When good people leave</title><content type='html'>&lt;div id="story_content"&gt;       &lt;p&gt; &lt;b&gt;Why are star employees so hard to keep?&lt;/b&gt;&lt;/p&gt;&lt;p&gt; A SENIOR manager was complaining that no matter what they did, good people tended to leave the company after a few years. He was at his wits’ end. &lt;/p&gt;&lt;p&gt;  To be fair, he is worth his salt as a leader of the team. He believes in keeping good people. But why are his “stars” leaving?&lt;/p&gt;&lt;p&gt; Ask any clever executive and he will give you a list of reasons why he will stay with a company and why he will walk away despite the remuneration package. The main problem lies with their immediate supervisors, who really have no clue about nurturing them and getting the best out of them.&lt;/p&gt;&lt;p&gt; Hiring talented people is hard enough but trying to keep them can be harder because job opportunities abound and talented people will find little “niches” where they fit perfectly. Again these “stars” are visible and marketable and a clever employer would try to lure them over. &lt;/p&gt;&lt;p&gt;  Ask a talented executive the real reason why he/she is leaving and you might get the following reasons: &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;li&gt;Bosses who have gone up the corporate ladder with no leadership skills training. They have big egos and few or non-existent leadership skills. They bully their staff, blame others and find convenient scapegoats for their mistakes and feel threatened by staff who appear clever or more skilled than them. Such bosses are commonly found in the corporate world; most of them stay where they are, torturing their staff, because they have a “godfather” in senior management position. In turn, senior management finds it increasingly difficult to acknowledge the fact that its choice of “manager” is suspect. &lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;The “nature of the job”. Clever executives want challenges that drive them towards excellence. One little flaw in their character is that they get bored easily. That is why bosses need to consider how they can get the best from their staff. When you expect your staff to do the same job year in and year out, with no “escape clause”, they will leave – no matter what you pay. Remember, the market will bear the cost of excellence.&lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Lack of “succession planning”. If an organisation does not have one in place, the message you give your staff is: “we do not have a career path for you.” This is tough on young, energetic people who have personal goals, including going up the corporate ladder. So if the boss has no plans for the employees, they will find a company that has one. &lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;The work environment. If bosses do not generate a good corporate culture, the staff will lose their motivation. A career will become “just a job”. What drives people away? A department in which the staff is not nurtured, a company where bosses are indifferent to the needs of the staff, or a place where no one practises basic courtesies. &lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Standards and procedures in an office. If there is favouritism and the boss’ decisions smack of discrimination, if people abuse the system and no one cares, then good people leave. &lt;p&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Lack of learning opportunities. Many companies feel that training is a waste of money, not realising that it is one way to show your staff that you care about their development, both personal and professional. I knew of one boss who refused to do soft-skills training because it would not “benefit” the company and only develop the person. &lt;p&gt; Every time a company loses its staff, the losses are greater than what you see on the surface. Look at the visible and the hidden costs. To recruit people, a company spends money on advertisements and interviews (which also take time). Next, new recruits need training. Then there are the remuneration and other benefits that need to be considered. The list goes on. Imagine if you work in a company where there is high turnover and no one cares. It is hard-earned money which could be put to better use.&lt;/p&gt;&lt;p&gt; Many young people do not want to work for someone else. They do not suffer fools gladly and you cannot blame them. It is pathetic to see highly-placed leaders who are unable to handle issues or crises – and they make no apologies for that. The sad fact remains that we are willing to put up with mediocrity and suffer in silence.&lt;/p&gt;&lt;p&gt; Human resource experts feel that greater synergy of human resource involves “job designing”. Bosses need to find out more about the “passion, interests and desires” of executives. What will challenge them and bring out the best in them? Succession planning could also be based on these principles. &lt;/p&gt;&lt;p&gt; We do not have to look far. Great industrialists are people who take challenges despite overwhelming odds. They have the ability to attract the best talent in the world because they are able to challenge young people to take risks, look beyond their scope of work, be creative and do the unthinkable.&lt;/p&gt;&lt;p&gt; There was once an IT expert who was trying to improve a mechanical device. He finally succeeded and, with great enthusiasm, ran to his boss’ room to show him what he’d done. &lt;/p&gt;&lt;p&gt;  The boss, excited, jumped up, shook his hand vigorously and said: “Wait, I must give you a reward.” &lt;/p&gt;&lt;p&gt; Looking around the office and pulling out his drawers, all he found was his lunch – a banana. He handed the banana to the staff and said: “Have this.” &lt;/p&gt;&lt;p&gt; The subordinate walked away, quite puzzled with his “prize”. But he was greatly thrilled when he was later awarded the “Best Innovation Prize”, which was a “golden banana”. &lt;/p&gt;&lt;p&gt;  He still works for the company.      &lt;/p&gt;&lt;/li&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-7046500666902145118?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/7046500666902145118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=7046500666902145118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7046500666902145118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7046500666902145118'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/04/when-good-people-leave.html' title='When good people leave'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-7315008607860425811</id><published>2008-01-03T15:35:00.002+08:00</published><updated>2008-10-01T08:50:15.461+08:00</updated><title type='text'>Find the CultureInfo by ISO Currency Code</title><content type='html'>&lt;span style="font-family:Verdana;"&gt;&lt;br /&gt;Below is the code that find the CultureInfo by ISO Currency Code&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 128, 128);"&gt;CultureInfo&lt;/span&gt; CultureInfoFromCurrencyISO( &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt; isoCode )&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;CultureInfo&lt;/span&gt;[] cultures = &lt;span style="color: rgb(0, 128, 128);"&gt;CultureInfo&lt;/span&gt;.GetCultures(&lt;span style="color: rgb(0, 128, 128);"&gt;CultureTypes&lt;/span&gt;.SpecificCultures);&lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   foreach&lt;/span&gt; (&lt;span style="color: rgb(0, 128, 128);"&gt;CultureInfo&lt;/span&gt; ci &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; cultures)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;RegionInfo&lt;/span&gt; ri = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(0, 128, 128);"&gt;RegionInfo&lt;/span&gt;(ci.LCID);&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (ri.ISOCurrencySymbol == isoCode)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;      return&lt;/span&gt; ci;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;   return&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;// Since one ISO Currency Code may be associated with more than one LCIDs&lt;br /&gt;// We could rewrite the code to the following&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 102, 0);"&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt; &lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;IList&lt;/span&gt; CultureInfoFromCurrencyISO(&lt;span style="color: blue;"&gt;string&lt;/span&gt; isoCode)&lt;/p&gt; &lt;p style="margin: 0px;"&gt;{&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    &lt;span style="color: #2b91af;"&gt;CultureInfo&lt;/span&gt;[] cultures = &lt;span style="color: #2b91af;"&gt;CultureInfo&lt;/span&gt;.GetCultures(&lt;span style="color: #2b91af;"&gt;CultureTypes&lt;/span&gt;.SpecificCultures);&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    &lt;span style="color: #2b91af;"&gt;IList&lt;/span&gt; Result = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ArrayList&lt;/span&gt;();&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;CultureInfo&lt;/span&gt; ci &lt;span style="color: blue;"&gt;in&lt;/span&gt; cultures)&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    {&lt;/p&gt; &lt;p style="margin: 0px;"&gt;        &lt;span style="color: #2b91af;"&gt;RegionInfo&lt;/span&gt; ri = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;RegionInfo&lt;/span&gt;(ci.LCID);&lt;/p&gt; &lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;if&lt;/span&gt; (ri.ISOCurrencySymbol == isoCode)&lt;/p&gt; &lt;p style="margin: 0px;"&gt;        {&lt;/p&gt; &lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt;(!Result.Contains(ci))&lt;/p&gt; &lt;p style="margin: 0px;"&gt;                Result.Add(ci);&lt;/p&gt; &lt;p style="margin: 0px;"&gt;        }&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    }&lt;/p&gt; &lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;return&lt;/span&gt; Result;&lt;/p&gt; &lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-7315008607860425811?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/7315008607860425811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=7315008607860425811' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7315008607860425811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/7315008607860425811'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2008/01/find-cultureinfo-by-iso-currency-code.html' title='Find the CultureInfo by ISO Currency Code'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-116642372313954027</id><published>2006-12-18T14:33:00.000+08:00</published><updated>2006-12-18T14:35:23.396+08:00</updated><title type='text'>Sending Mail with ASP.NET 2.0</title><content type='html'>MailMessage msg = new MailMessage();&lt;br /&gt;msg.From = new MailAddress("address@domain.com", "Person's Name");&lt;br /&gt;msg.To.Add(new MailAddress("destination@domain.com",&lt;br /&gt;                           "Addressee's Name");&lt;br /&gt;msg.To.Add(new MailAddress("destination2@domain.com",&lt;br /&gt;                           "Addressee 2's Name");&lt;br /&gt;msg.Subject    = "Message Subject";&lt;br /&gt;msg.Body       = "Mail body content";&lt;br /&gt;msg.IsBodyHtml = true;&lt;br /&gt;msg.Priority   = MailPriority.High;&lt;br /&gt;SmtpClient c   = new SmtpClient("mailserver.domain.com");&lt;br /&gt;c.Send(msg);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-116642372313954027?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/116642372313954027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=116642372313954027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/116642372313954027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/116642372313954027'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2006/12/sending-mail-with-aspnet-20.html' title='Sending Mail with ASP.NET 2.0'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-115649911373592339</id><published>2006-08-25T17:41:00.000+08:00</published><updated>2006-08-25T17:45:13.860+08:00</updated><title type='text'>A Single Sign-in Web Service in ASP.NET</title><content type='html'>&lt;style type="text/css"&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;/*****************************************************&lt;br /&gt;ASP.NET Forums default theme&lt;br /&gt;Modify this stylesheet to change the colours&lt;br /&gt;and appearance of the ASP.NET Forums&lt;br /&gt;*****************************************************/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;body /*The scroll bar colours are only visible in IE5.5+ */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    COLOR: #000000;&lt;br /&gt;    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    background-color: #FFF; &lt;br /&gt; scrollbar-arrow-color: #3B88C5;&lt;br /&gt; scrollbar-face-color: #FFFFFF; &lt;br /&gt; scrollbar-track-color: #E0E0E0; &lt;br /&gt; scrollbar-highlight-color: #FFFFFF; &lt;br /&gt; scrollbar-3dlight-color: #C0C0C0; &lt;br /&gt; scrollbar-shadow-color: #FFFFFF; &lt;br /&gt; scrollbar-darkshadow-color: #B0B0B0;&lt;br /&gt; height: 100%;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;pre.source&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt; margin-left: 20px;&lt;br /&gt; color: black;&lt;br /&gt; font-family: Lucida Console, Courier New, Courier;&lt;br /&gt; background-color: gainsboro;&lt;br /&gt;}&lt;br /&gt;body.admin /* Admin page style */&lt;br /&gt;{&lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;image /* used to align text to images, centered */&lt;br /&gt;{&lt;br /&gt; vertical-align: middle;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Forum Name Title&lt;br /&gt;*****************************************************/&lt;br /&gt;/* em: unit of measurement for the height of the element's font, which is resolution independent */&lt;br /&gt;.forumName /* text style for the main forum name */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;a.forumName:visited, a.forumName:link&lt;br /&gt;{&lt;br /&gt; font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;a.forumName:hover /* text style for when mouse hovers over main forum name */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.SiteName /* text style for the main forum name */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: White;&lt;br /&gt;}&lt;br /&gt;a.SiteName:visited, a.forumName:link&lt;br /&gt;{&lt;br /&gt; font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt; color: White;&lt;br /&gt;}&lt;br /&gt;a.SiteName:hover /* text style for when mouse hovers over main forum name */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.forumThread /* description of Forums on main page (underneath Forum Name) */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;/*****************************************************&lt;br /&gt;General Text&lt;br /&gt;*****************************************************/&lt;br /&gt;.txt1 { font-size : 9pt; } &lt;br /&gt;.txt2 { font-size : 9pt; }&lt;br /&gt;.txt3 { font-size : 9pt; }&lt;br /&gt;.txt4 { font-size : 9pt; word-break:break-all;}&lt;br /&gt;.txt5 { font-size : 9pt; }&lt;br /&gt;&lt;br /&gt;.txt1Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt2Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt3Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt4Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt5Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;&lt;br /&gt;.txt3red { font-size : 9pt; color: Red; }&lt;br /&gt;&lt;br /&gt;.printDetails{ font-size : 9pt; color: darkgray; }&lt;br /&gt;.noTopics { font-size: 9pt; font-weight:bold; }&lt;br /&gt;.dateText { font-size: 9pt; color: white; }&lt;br /&gt;.StatusIconText{ font-size: 9pt; font-weight:bold; }&lt;br /&gt;&lt;br /&gt;/* IRC Style Text */&lt;br /&gt;.txtIrcMe { color:Fuchsia ; }&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Tables&lt;br /&gt;*****************************************************/&lt;br /&gt;.tableBorder /* This is the outline round the main forum tables */&lt;br /&gt;{&lt;br /&gt;   &lt;br /&gt;    /*border: 1px outset; solid*/&lt;br /&gt;    border: 1px outset #42ADF1;&lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.moderationTable /* Moderation table */&lt;br /&gt;{&lt;br /&gt;    border: 1px #FFFFFF solid; &lt;br /&gt;    background-color: #F1F1F1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.adminTable /* Admin table */&lt;br /&gt;{&lt;br /&gt;    border: 1px #1C84D0 solid;&lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.quoteTable { /* This is the quote table, where quotes from previous posts are shown */&lt;br /&gt;    border:1px inset;&lt;br /&gt;    background-color: #EEF7FF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.editTable { /* This is the edit notes table, shown when someone has edited a post, and this feature is enabled */&lt;br /&gt;    border: 1px inset; &lt;br /&gt;    color: Red;&lt;br /&gt;    background-color: #EEF7FF;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Table Header and cell definitions&lt;br /&gt;*****************************************************/&lt;br /&gt;td.column /* td.column is the main heading row of the table, shows either the table title, or the column headings, such as 'Posts', 'Last Post' etc. Top row of all tables. */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold; &lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #78ABDE; &lt;br /&gt;    background-image: url(../images/bg_th.gif); &lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;    COLOR: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.h1a /* td.h1a is the subheading row of the table, shows the names of Forum Groups on main page, or 'Announcements', 'Topics' on ShowForum page */&lt;br /&gt;{&lt;br /&gt;    color: #4455aa;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    background-image: url(../images/forumHeaderBackgroundAlternate.gif);&lt;br /&gt;    background-color: #E7E3E7;&lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.h1 /* td.h1 was the old subheading row of the table. This should probably be deleted as I don't think it is used anymore. */&lt;br /&gt;{&lt;br /&gt;    color: white;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;    background-image: url(../images/forumHeaderBackground.gif);&lt;br /&gt;    background-color: #4455aa&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.f /* Forums column cells on main page; last post, replies, view cells on ShowForums page (shaded cells?) */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt; border-top: 0px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;td.f1 &lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt; border-top: 1px solid #53A3E2;&lt;br /&gt; border-right: 1px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;td.f2&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.fh&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF; &lt;br /&gt;    /*background-image: url(../images/fhBg.gif); */&lt;br /&gt;    background-image: url(../images/fhBg.gif);&lt;br /&gt;    background-repeat: repeat-x;&lt;br /&gt;}&lt;br /&gt;td.fh1 &lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF; &lt;br /&gt;    /*background-image: url(../images/fhBg.gif); */&lt;br /&gt;    background-image: url(../images/hdr_bg.gif);&lt;br /&gt;    background-repeat: repeat-x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh2 /* used in Forums Statistics box to control size of text*/&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3b /* TD.fh3 is Threads, Posts cells on main table, Thread cells on ShowForum page (not shaded?) */ &lt;br /&gt;&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3 /* TD.fh3 is Threads, Posts cells on main table, Thread cells on ShowForum page (not shaded?) */ &lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #53A3E2;&lt;br /&gt; border-left: 1px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3a /* TD.fh3a is Alternating table for Post Body in the PostView */ &lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #F6FBFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh4 /* TD.fh4 is Last Post cells on main table (not shaded?) */&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Background color and text used in threaded view&lt;br /&gt;*****************************************************/&lt;br /&gt;td.threadTitle&lt;br /&gt;{&lt;br /&gt;    background-color: #D4D9EC;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.threadDetailTextSmall&lt;br /&gt;{&lt;br /&gt;    color: #0055E7;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.threadDetailTextSmallBold&lt;br /&gt;{&lt;br /&gt;    color: #0055E7;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;}&lt;br /&gt;TD&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a, a:visited, a:link &lt;br /&gt;{&lt;br /&gt;    color: #013DA4;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a:Hover /* General page anchors */&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;    text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold, a.linkMenuSink &lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmall, a.LinkSmallBold, a.linkMenuSink&lt;br /&gt;{&lt;br /&gt;    color: navy;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold:visited, a.linkMenuSink:visited&lt;br /&gt;{&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold:Hover, a.linkMenuSink:Hover&lt;br /&gt;{&lt;br /&gt;/* color: #DD6900; */&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk3, a.lnk3:visited, a.lnk3:link&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk3:Hover&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Text and links used in ForumGroupRepeater and ForumRepeater&lt;br /&gt;*****************************************************/&lt;br /&gt;columnText, a.columnText, a.columnText:visited, a.columnText:link &lt;br /&gt;{  &lt;br /&gt; font-size: 9pt; &lt;br /&gt; color: white; &lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.columnText:hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.column:visited, a.column:link, a.column:hover&lt;br /&gt;{&lt;br /&gt;    color: white;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.flnk3&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.flnk3:visited, a.flnk3:link&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.flnk3:hover&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.inlineLink /* Username in ShowPost, next to online status */&lt;br /&gt;{&lt;br /&gt;  cursor:pointer;&lt;br /&gt;  color: #555555;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.inline &lt;br /&gt;{&lt;br /&gt;  font-size: 9pt;&lt;br /&gt;  color: #555555;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Text and Anchor to display when a user is online&lt;br /&gt;*****************************************************/&lt;br /&gt;&lt;br /&gt;.userOnlineLink, a.userOnlineLink, a.userOnlineLink:Visited, a.userOnlineLink:Link&lt;br /&gt;/* text style to show when a user is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.userOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.moderatorOnlineLinkBold, a.moderatorOnlineLinkBold, a.moderatorOnlineLinkBold:Visited, a.moderatorOnlineLinkBold:Link&lt;br /&gt;/* text style to show when a moderator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 044AC4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.moderatorOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.supermoderatorOnlineLinkBold, a.supermoderatorOnlineLinkBold, a.supermoderatorOnlineLinkBold:Visited, a.supermoderatorOnlineLinkBold:Link&lt;br /&gt;/* text style to show when a moderator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 0352DC;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.supermoderatorOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.adminOnlineLinkBold, a.adminOnlineLinkBold, a.adminOnlineLinkBold:Visited, a.adminOnlineLinkBold:Link&lt;br /&gt;/* text style to show when an administrator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 035FFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.adminOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Navigation: Text and anchors used in the navigation menu&lt;br /&gt;*****************************************************/&lt;br /&gt;.menuText /* Font used for navigation menu */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.menuLink:visited, a.menuLink:link /* Font used for links in the navigation menu */&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt; font-weight: normal;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    color: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.menuLink:Hover /* Font used for hovering over a link in the navigation menu */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;.menuLink&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;td.menuBg &lt;br /&gt;{&lt;br /&gt;     background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Default separator style for PostList&lt;br /&gt;*****************************************************/&lt;br /&gt;td.flatViewSpacing /* Separates Users from Guests in WhoIsOnline page */&lt;br /&gt;{&lt;br /&gt; height: 2px; &lt;br /&gt; background-color: #80B7FF; &lt;br /&gt;} &lt;br /&gt;td.threadSeparator /* Separates posts in ShowPost page */&lt;br /&gt;{&lt;br /&gt; height: 4px; &lt;br /&gt; background-color: #79ABDE; &lt;br /&gt;} &lt;br /&gt;td.adminSeparator /* Separates 'groups of options' in Admin Nav Bar */&lt;br /&gt;{&lt;br /&gt; height: 4px; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt;} &lt;br /&gt;td.moderateSeparator /* Separator in ModerateForum page */&lt;br /&gt;{&lt;br /&gt; height: 12px; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Validation Text&lt;br /&gt;*****************************************************/&lt;br /&gt;.validationWarning &lt;br /&gt;{&lt;br /&gt; color: Red; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Page control selected page&lt;br /&gt;*****************************************************/&lt;br /&gt;.currentPage &lt;br /&gt;{&lt;br /&gt; font-size : 12pt; &lt;br /&gt; font-weight:bold; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Form Elements&lt;br /&gt;*****************************************************/&lt;br /&gt;select /* drop down lists in forms */&lt;br /&gt;{&lt;br /&gt;    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;textarea /* large multi-line text boxes in forms */&lt;br /&gt;{&lt;br /&gt;    font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;input /* input elements in forms, e.g radio buttons, text boxes, etc. */&lt;br /&gt;{&lt;br /&gt;    font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Control Panel&lt;br /&gt;*****************************************************/&lt;br /&gt;td.ControlPanelTabActive &lt;br /&gt;{&lt;br /&gt;    font-weight: bold; &lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #78ABDE; &lt;br /&gt;    background-image: url(../images/forumColumnBackground.gif); &lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;    COLOR: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.ControlPanelTabInactive &lt;br /&gt;{&lt;br /&gt; color: #4455aa;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    background-image: url(../images/forumHeaderBackgroundAlternate.gif);&lt;br /&gt;    background-color: #E7E3E7;&lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.ControlPanelTabLine&lt;br /&gt;{&lt;br /&gt; background-color: #7AACE0;&lt;br /&gt;}&lt;br /&gt;td.border_left { &lt;br /&gt; background-image: url(../images/border_left.gif); &lt;br /&gt; width: 10px; &lt;br /&gt;}&lt;br /&gt;td.border_right { &lt;br /&gt; background-image: url(../images/border_right.gif); &lt;br /&gt; width: 10px;&lt;br /&gt;}&lt;br /&gt;td.logo_bg { &lt;br /&gt; background-image: url(../images/logo_bg.gif); &lt;br /&gt; background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;#content { &lt;br /&gt; text-align: left; &lt;br /&gt;  width: 100%;&lt;br /&gt; margin: 5px;&lt;br /&gt; width: auto;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.QuickPostText&lt;br /&gt;{&lt;br /&gt; color: red;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk4, a.lnk4:visited, a.lnk4:link &lt;br /&gt;{ &lt;br /&gt; font-size: 9pt;&lt;br /&gt; color: #A3A3A3;&lt;br /&gt; font-weight: bold; &lt;br /&gt;}&lt;br /&gt;a.lnk4:Hover &lt;br /&gt;{ &lt;br /&gt; color: #FF3300; &lt;br /&gt; text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk5, a.lnk5:visited, a.lnk5:link &lt;br /&gt;{ &lt;br /&gt; font-size: 9pt;&lt;br /&gt; color: #F67340;&lt;br /&gt; font-weight: bold; &lt;br /&gt;}&lt;br /&gt;a.lnk5:Hover &lt;br /&gt;{ &lt;br /&gt; color: #F64D0B; &lt;br /&gt; text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;--&gt;&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Most of today's sites require users to undertake a  registration process to allow the site owners to keep in touch with, or  offer services to, those visitors. Building up a user base like this  requires patience and dedication. Offer a new service or a new Website,  however, and, typically, you'll need to start your user base from  scratch yet again. &lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This article outlines a strategy for creating portable membership  tools. We'll see how Web Services and server controls give you ability  to produce a single sign-in for all your sites and resources.&lt;/p&gt;&lt;br /&gt;&lt;h5&gt;The Challenge&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;The notion of a single sign-in for a Website has been around for  years. Most notably, Microsoft's implementation in the form of the &lt;a href="http://www.sitepoint.com/glossary.php?q=%23#term_2" title=".NET is an application framework from Microsoft."&gt;.NET&lt;/a&gt; Passport, and the Liberty Alliance Project (backed by big hitters like  Visa and GM), have had moderate success in saving users and developers  from the issues of site membership.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;However, the license fees of systems like Passport put it out of the  reach of many Web developers. Passport, for example, costs $10,000 a  year and an additional $1,500 compliance fee per URL. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;While the tools outlined in this article won't give you all the  advantages of using Passport (most notably, Passport's 200  million-strong user base, or its security), the solution we'll discuss  does offer a simple method of organising your user base over multiple  sites or resources.&lt;/p&gt;&lt;br /&gt;&lt;h5&gt;Architecture&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;The design of the tools needs to be such that we can create separate  applications -- even non-.NET applications -- and still access and  authenticate our user base.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Web Services&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The heart of the login system is a Web service. A Web service allows  you to extract and distribute specific functionality of your  applications so that it can be reused by other applications, even if  they aren't written in .NET. This provides the perfect platform for our  login system, affording us the flexibility to produce some of our sites  as non-.NET applications; for example, &lt;a href="http://www.sitepoint.com/glossary.php?q=P#term_1" title="PHP, or Hypertext Preprocessor, is an open source, server-side programming language."&gt;PHP&lt;/a&gt;, &lt;a href="http://www.sitepoint.com/glossary.php?q=A#term_4" title="Active Server Pages, or ASP, is Microsoft's IIS based server side scripting architecture."&gt;ASP&lt;/a&gt;, or &lt;a href="http://www.sitepoint.com/glossary.php?q=J#term_6" title="JavaServer Pages, or JSP, is Sun's Java-powered, server-side scripting environment."&gt;JSP&lt;/a&gt;. We can even write desktop applications to include our login functionality.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Database Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;A database will contain information for all our users, and is  queried by the Web service to authenticate, locate, and return users to  our applications. As only the Web service will communicate with the  database directly, our applications will not need to know how to access  the database, nor deal with SQL statements.&lt;/p&gt;&lt;br /&gt;&lt;div id="adz"&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;The Member Object&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The Web service will use a Member object defined by us to represent  a user of our site. This object will give us access to the details of  the currently signed-in user.&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;    &lt;strong&gt;&lt;em&gt;User Controls&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After we produce our Web service, we can build some &lt;a href="http://www.sitepoint.com/glossary.php?q=%23#term_2" title=".NET is an application framework from Microsoft."&gt;ASP.NET&lt;/a&gt; user controls that encapsulate the common functionality of user  registration and authentication. The user controls will communicate  with the Web service, presenting us with simple properties and events  to control the membership of our site.&lt;/p&gt;&lt;br /&gt;&lt;h5&gt;Designing the Login Web Service&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;The Web service needs to encapsulate all the functionality we'll  require to register and authenticate a user; hence it will require the  following methods:&lt;/p&gt;&lt;br /&gt;&lt;p&gt; bool createUser(Member m) &lt;br /&gt;&lt;br /&gt;  Member authenticateUser(string userName, string password)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Of course, this isn't all the functionality that's possible. We  could, for example, have methods to control the modification of a user,  the loss of a password, or the removal of a user from our system.  However, this article will concentrate on creation and authentication.&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  Both of the methods reference an object, Member. This class will  represent a user; it contains all the information we know about the  user we're dealing with. The class will have the following properties:&lt;/p&gt;&lt;br /&gt;&lt;p&gt; string userName; &lt;br /&gt;&lt;br /&gt;  string hashedPassword; &lt;br /&gt;&lt;br /&gt;  string emailAddress; &lt;br /&gt;&lt;br /&gt;  string fullName;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here's the C# source code for this class. There's nothing fancy here, just code for the four properties:&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  namespace Sitepoint.SingleLogIn &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  public class Member &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  private string _UserName; &lt;br /&gt;&lt;br /&gt;  private string _Password; &lt;br /&gt;&lt;br /&gt;  private string _FullName; &lt;br /&gt;&lt;br /&gt;  private string _EmailAddress; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  public string UserName &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  get &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return _UserName; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  set &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  _UserName = value; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  public string Password &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  get &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return _Password; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  set &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  _Password = value; &lt;br /&gt;&lt;br /&gt;  }     &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  public string EmailAddress &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  get &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return _EmailAddress; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  set &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  _EmailAddress = value; &lt;br /&gt;&lt;br /&gt;  }     &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  public string FullName &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  get &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return _FullName; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  set &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  _FullName = value; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  }  &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To create a user on our system, we first create an instance of the  Member class and fill it with the personal information for the user. We  then pass this to the createUser method on the Web service. This  returns true for a successful addition, and false if a problem is found  with the information (for example, if the username already exists).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To authenticate a user, we pass that user's username and password to  the Web service and, if these details are authenticated, a Member  object representing the user is returned.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;A database table will be used to store our user details. The fields of this table will correspond to the user information:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img src="http://i2.sitepoint.com/graphics/singlesignin1.png" alt="1378_table1" height="131" width="528" /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  Hence, the SQL we'll use to create the table is as follows:&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  CREATE TABLE User &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  ID int IDENTITY (1,1) NOT NULL, &lt;br /&gt;&lt;br /&gt;  UserName varchar(200) NOT NULL, &lt;br /&gt;&lt;br /&gt;  Password varchar(64) NOT NULL, &lt;br /&gt;&lt;br /&gt;  EmailAddress varchar(200), &lt;br /&gt;&lt;br /&gt;  FullName varchar(200) &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;With the database created, and our Member class coded, we can now flesh out the methods in the Web service to include our functionality.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The createUser method will first check to see if the username contained within the passed Member object has been registered before (implemented in the private method userExists).  If it has, the method will return false. If all is well, however, the  user can be added to the database (through the private method addUser).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;All passwords are stored as hashes of the original password for the  sake of security. As we'll see with the server controls, this  functionality is encapsulated. However, if we weren't using the  controls -- say we created a non-&lt;a href="http://www.sitepoint.com/glossary.php?q=%23#term_2" title=".NET is an application framework from Microsoft."&gt;.NET&lt;/a&gt; or desktop application – we'd need to remember that plain text passwords cannot be passed over the network connection.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; [WebMethod] &lt;br /&gt;&lt;br /&gt;  public bool createUser(Member m) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //check that the username doesn't already exist &lt;br /&gt;&lt;br /&gt;  if (!userExists(m.UserName)) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return false; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  //add the user &lt;br /&gt;&lt;br /&gt;  if (!addUser(m)) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  return false; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  return true; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  private bool userExists(string UserName) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  conn.Open(); &lt;br /&gt;&lt;br /&gt;  SqlCommand comm = new SqlCommand(&amp;quot;select id from User where username = @username&amp;quot;,conn);  &lt;br /&gt;&lt;br /&gt;  SqlParameter p = new SqlParameter(&amp;quot;@username&amp;quot;,UserName); &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(p); &lt;br /&gt;&lt;br /&gt;  SqlDataReader r = comm.ExecuteReader(); &lt;br /&gt;&lt;br /&gt;  bool result = r.HasRows; &lt;br /&gt;&lt;br /&gt;  conn.Close(); &lt;br /&gt;&lt;br /&gt;  return result; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  private bool addUser(Member m) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  conn.Open(); &lt;br /&gt;&lt;br /&gt;  SqlCommand comm = new SqlCommand(&amp;quot;insert into User(UserName,  Password, FullName, EmailAddress) values (@username, @password,  @fullname, @emailaddress)&amp;quot;,conn); &lt;br /&gt;&lt;br /&gt;  SqlParameter pUserName = new SqlParameter(&amp;quot;@username&amp;quot;,m.UserName); &lt;br /&gt;&lt;br /&gt;  SqlParameter pPassword = new SqlParameter(&amp;quot;@password&amp;quot;,m.Password); &lt;br /&gt;&lt;br /&gt;  SqlParameter pFullName = new SqlParameter(&amp;quot;@fullname&amp;quot;,m.FullName); &lt;br /&gt;&lt;br /&gt;  SqlParameter pEmailAddress = new SqlParameter(&amp;quot;@emailaddress&amp;quot;,m.EmailAddress); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pUserName); &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pPassword); &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pFullName); &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pEmailAddress); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  int result = comm.ExecuteNonQuery(); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  //we should have 1 result returned. else, it failed &lt;br /&gt;&lt;br /&gt;  return (result ==1); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The authenticateUser method is the meat of our service.  By passing a username and a hashed password of the user (taken from a  Web form, for example) a Member object that represents  the user is returned. The method queries the database to see if a row  exists that contains both the username and the password. If a row is  found, the user is authenticated, and the object is created from the  row. Otherwise, we've been given incorrect credentials, and a null is  returned.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; [WebMethod] &lt;br /&gt;&lt;br /&gt;  public Member AuthenticateUser(string UserName, string Password) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //check that the username doesn't already exist &lt;br /&gt;&lt;br /&gt;  return authenticateUser(UserName, Password);     &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  private Member authenticateUser(string UserName, string Password) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  conn.Open(); &lt;br /&gt;&lt;br /&gt;  SqlCommand comm = new SqlCommand(&amp;quot;select fullname, emailaddress from  User where username = @username AND password = @password&amp;quot;,conn);  &lt;br /&gt;&lt;br /&gt;  SqlParameter pUserName = new SqlParameter(&amp;quot;@username&amp;quot;,UserName); &lt;br /&gt;&lt;br /&gt;  SqlParameter pPassword = new SqlParameter(&amp;quot;@password&amp;quot;,Password); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pUserName); &lt;br /&gt;&lt;br /&gt;  comm.Parameters.Add(pPassword); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  SqlDataReader r = comm.ExecuteReader(); &lt;br /&gt;&lt;br /&gt;  bool result = r.HasRows; &lt;br /&gt;&lt;br /&gt;  conn.Close(); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  if (result) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //build a new member object &lt;br /&gt;&lt;br /&gt;  Member m = new Member(); &lt;br /&gt;&lt;br /&gt;  m.UserName = UserName; &lt;br /&gt;&lt;br /&gt;  m.Password = Password; &lt;br /&gt;&lt;br /&gt;  m.FullName = r.GetString(0); &lt;br /&gt;&lt;br /&gt;  m.EmailAddress = r.GetString(1); &lt;br /&gt;&lt;br /&gt;  return m; &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  return null; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a target="_blank" rel="external" href="http://www.sitepoint.com/examples/singlesignin/singlesignin.zip"&gt;Click here to download the Web Service file&lt;/a&gt;.  To deploy the service, copy it to your Web application (either through  FTP, or by adding it to your Project in Visual Studio.NET)&lt;/p&gt;&lt;br /&gt;&lt;h5&gt;Designing the User Controls&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;We can build user controls to encapsulate the creation and  authentication of a user in our system. User controls are, in essence,  encapsulated areas of a page that you can drop into Web forms to allow  the quick reuse of your code. For example, here, we'll be creating Login and Register User  forms, both of which we'll place inside a user control file. To use  either the login or the registration forms, we'd simply drag and drop  (or, if we're not using Visual Studio, reference) the controls onto our  pages. Read the &lt;a target="_blank" rel="external" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontowebusercontrols.asp"&gt;MSDN entry&lt;/a&gt; for User Controls for more information.&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;  The createUser  user control can be placed within a Web Form to offer the automatic  registration of a user. The control includes text boxes that allow  users to input usernames, passwords, email addresses, and full names.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the click event of the register button, we call the Web service LogIn,  created above, to create the user, and check to see if the procedure  was successful or not. If the creation was successful, we redirect to a  new page that tells the user what to do next. Otherwise, a previously  hidden Label control containing an error message is made visible, and  the user tries again.&lt;/p&gt;&lt;br /&gt;&lt;div id="div"&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;You can find the completed createUser.ascx file in the code archive.  Worthy of note, however, is the click event for the button on our  control (the code that's run when the user clicks Register).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here, the code grabs the information that's input by the user, and fills a Member object, created earlier, with the details:&lt;/p&gt;&lt;br /&gt;&lt;p&gt; Sitepoint.SingleLogIn.Member m = new Member(); &lt;br /&gt;&lt;br /&gt;  m.UserName = txtUserName.Text; &lt;br /&gt;&lt;br /&gt;  m.Password = System.Web.Security.FormsAuthentication. &lt;br /&gt;&lt;br /&gt;  HashPasswordForStoringInConfigFile(txtPassword.Text, &amp;quot;sha1&amp;quot;); &lt;br /&gt;&lt;br /&gt;  m.FullName = txtFullName.Text; &lt;br /&gt;&lt;br /&gt;  m.EmailAddress = txtEmailAddress.Text;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;We then create an instance of our login service and pass our new  member object to it to register the user. If this is successful, we can  redirect users to a page that informs them that their registration has  been successful. Otherwise, we can show the previously hidden error  label, which asks the user to try a different username. &lt;/p&gt;&lt;br /&gt;&lt;p&gt; Sitepoint.SingleLogIn.login login = new  Sitepoint.SingleLogIn.login(); &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  if (login.createUser(m)) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //success. user created. &lt;br /&gt;&lt;br /&gt;  //in this example, we redirect to the success page &lt;br /&gt;&lt;br /&gt;  Response.Redirect(&amp;quot;success.aspx&amp;quot;,true); &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  else &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //try again. &lt;br /&gt;&lt;br /&gt;  lblError.Visible = true; &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt; The authenticateUser user control is very similar to the createUser control; however, when authentication is successful, we set a session &lt;a href="http://www.sitepoint.com/glossary.php?q=C#term_59" title="Cookies are pieces of data that a Website uses to 'brand' users' computers in order to identify them individually."&gt;cookie&lt;/a&gt; to store the Member object we retrieved from the authentication method. In future, we can check to see if this object exists within our &lt;a href="http://www.sitepoint.com/glossary.php?q=C#term_21" title="Cache, pronounced 'cash', refes to a stored copy of (or pointers to) previously accessed data. "&gt;cache&lt;/a&gt;, and thereby ascertain whether the current user is logged in or not.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Again, you can find the completed authenicateUser.ascx file in the code archive. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;This time, we wish to authenticate a user, so we take the username  and password input by the user, and with them retrieve the appropriate member object from our Web service: &lt;/p&gt;&lt;br /&gt;&lt;p&gt; Sitepoint.SingleLogIn.login l = new Sitepoint.SingleLogIn.login(); &lt;br /&gt;&lt;br /&gt;  Sitepoint.SingleLogIn.Member m = l.AuthenticateUser(txtUserName.Text,  System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text,  &amp;quot;sha1&amp;quot;));&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If no member object is returned (i.e. m is null),  then no user was found with that username and password combination. If  this is the case, we show the error label, and ask the user to try  again.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; if (m == null) &lt;br /&gt;&lt;br /&gt;  { &lt;br /&gt;&lt;br /&gt;  //not authenticated &lt;br /&gt;&lt;br /&gt;  lblError.Visible = true; &lt;br /&gt;&lt;br /&gt;  return; &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Otherwise, we now have an authenticated user. The member  object is added to the session state (we can retrieve this through our  application at a later time), and an authenticated variable is set to true.  This provides a quick method of ascertaining whether a user is  authenticated (comparing a Boolean value is much quicker and more  efficient than comparing an object to null):&lt;/p&gt;&lt;br /&gt;&lt;p&gt; // authenticated &lt;br /&gt;&lt;br /&gt;  Session[&amp;quot;user&amp;quot;] = m; &lt;br /&gt;&lt;br /&gt;  Session[&amp;quot;authenticated&amp;quot;] = true; &lt;br /&gt;&lt;br /&gt;  Response.Redirect(&amp;quot;homepage.aspx&amp;quot;);&lt;/p&gt;&lt;br /&gt;&lt;h5&gt;Using the Login System&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;It's time to put our code to use!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Using Visual Studio.NET&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;In the Web application with which you wish to use your  login system, add a Web reference to the Login Web service and add the  user controls to the project.&lt;/li&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Drag and drop the user controls onto the forms with which you wish to log in or create a user.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Without .NET&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Upload the login.asmx and your 2 user control files to your Web application directory.&lt;/li&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create a &lt;a target="_blank" rel="external" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconCreatingWebServiceProxy.asp"&gt;Web service proxy&lt;/a&gt; class to the login.asmx service. When compiling the application, make sure you add this proxy class into the command line.&lt;/li&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  &lt;li&gt;In Web forms with which you wish to use the UserControls, add a directive at the top of the form code.&lt;/li&gt;&lt;br /&gt;  &lt;p&gt;For the registration (createUser) control, add:&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;&amp;lt;%@ Register TagPrefix=&amp;quot;uc1&amp;quot; TagName=&amp;quot;createUser&amp;quot; Src=&amp;quot;createUser.ascx&amp;quot; %&amp;gt;&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;For the login (authenticateUser) control, add:&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;&amp;lt;%@ Register TagPrefix=&amp;quot;uc1&amp;quot; TagName=&amp;quot;authenticateUser&amp;quot; Src=&amp;quot;authenticateUser.ascx&amp;quot; %&amp;gt;&lt;/p&gt;&lt;br /&gt;  &lt;p&gt; &lt;/p&gt;&lt;br /&gt;  &lt;li&gt;To use the controls within your page, add the following tag for the registration control:&lt;/li&gt;&lt;br /&gt;  &lt;p&gt;&amp;lt;uc1:createUser id=&amp;quot;CreateUser1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/uc1:createUser&amp;gt;&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;Add the tag below for the login (authenticateUser) control:&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;&amp;lt;uc1:authenticateUser id=&amp;quot;AuthenticateUser1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/uc1:authenticateUser&amp;gt;&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;Now, if you need to ascertain whether the current session is logged in, you can check the Session object to see if a user object exists, like so:&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;if (Session[&amp;quot;user&amp;quot;] != null)  &lt;br /&gt;&lt;br /&gt;    { &lt;br /&gt;&lt;br /&gt;    //logged in    &lt;br /&gt;&lt;br /&gt;    } &lt;br /&gt;&lt;br /&gt;    else &lt;br /&gt;&lt;br /&gt;    {      &lt;br /&gt;&lt;br /&gt;    //no user &lt;br /&gt;&lt;br /&gt;    }&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;And, to log out a user, remove the user object from the Session object, as follows:&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;Session.Remove(&amp;quot;user&amp;quot;); &lt;/p&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h5&gt;Summary&lt;/h5&gt;&lt;br /&gt;&lt;p&gt;By encapsulating code within Web services and user controls, you can  easily make repetitive tasks such as user management simpler to manage.  And, by sharing the login system across your sites, not only can you  share your membership, you also share the code behind the system,  making any updates appear seamlessly across your network.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-115649911373592339?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/115649911373592339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=115649911373592339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115649911373592339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115649911373592339'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2006/08/single-sign-in-web-service-in-aspnet.html' title='A Single Sign-in Web Service in ASP.NET'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-115649742747658372</id><published>2006-08-25T17:08:00.000+08:00</published><updated>2006-08-25T17:28:44.130+08:00</updated><title type='text'>ASP.NET Single Sign On</title><content type='html'>&lt;style type="text/css"&gt;&lt;br /&gt;&lt;!--&lt;br /&gt;/*****************************************************&lt;br /&gt;ASP.NET Forums default theme&lt;br /&gt;Modify this stylesheet to change the colours&lt;br /&gt;and appearance of the ASP.NET Forums&lt;br /&gt;*****************************************************/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;body /*The scroll bar colours are only visible in IE5.5+ */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    COLOR: #000000;&lt;br /&gt;    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    background-color: #FFF; &lt;br /&gt; scrollbar-arrow-color: #3B88C5;&lt;br /&gt; scrollbar-face-color: #FFFFFF; &lt;br /&gt; scrollbar-track-color: #E0E0E0; &lt;br /&gt; scrollbar-highlight-color: #FFFFFF; &lt;br /&gt; scrollbar-3dlight-color: #C0C0C0; &lt;br /&gt; scrollbar-shadow-color: #FFFFFF; &lt;br /&gt; scrollbar-darkshadow-color: #B0B0B0;&lt;br /&gt; height: 100%;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;pre.source&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt; margin-left: 20px;&lt;br /&gt; color: black;&lt;br /&gt; font-family: Lucida Console, Courier New, Courier;&lt;br /&gt; background-color: gainsboro;&lt;br /&gt;}&lt;br /&gt;body.admin /* Admin page style */&lt;br /&gt;{&lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;image /* used to align text to images, centered */&lt;br /&gt;{&lt;br /&gt; vertical-align: middle;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Forum Name Title&lt;br /&gt;*****************************************************/&lt;br /&gt;/* em: unit of measurement for the height of the element's font, which is resolution independent */&lt;br /&gt;.forumName /* text style for the main forum name */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    &lt;br /&gt;}&lt;br /&gt;a.forumName:visited, a.forumName:link&lt;br /&gt;{&lt;br /&gt; font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;a.forumName:hover /* text style for when mouse hovers over main forum name */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.SiteName /* text style for the main forum name */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: White;&lt;br /&gt;}&lt;br /&gt;a.SiteName:visited, a.forumName:link&lt;br /&gt;{&lt;br /&gt; font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 14pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt; color: White;&lt;br /&gt;}&lt;br /&gt;a.SiteName:hover /* text style for when mouse hovers over main forum name */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.forumThread /* description of Forums on main page (underneath Forum Name) */&lt;br /&gt;{&lt;br /&gt;    font-family: Trebuchet MS, Arial, Helvetica;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;/*****************************************************&lt;br /&gt;General Text&lt;br /&gt;*****************************************************/&lt;br /&gt;.txt1 { font-size : 9pt; } &lt;br /&gt;.txt2 { font-size : 9pt; }&lt;br /&gt;.txt3 { font-size : 9pt; }&lt;br /&gt;.txt4 { font-size : 9pt; word-break:break-all;}&lt;br /&gt;.txt5 { font-size : 9pt; }&lt;br /&gt;&lt;br /&gt;.txt1Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt2Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt3Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt4Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;.txt5Bold { font-size : 9pt; font-weight:bold; }&lt;br /&gt;&lt;br /&gt;.txt3red { font-size : 9pt; color: Red; }&lt;br /&gt;&lt;br /&gt;.printDetails{ font-size : 9pt; color: darkgray; }&lt;br /&gt;.noTopics { font-size: 9pt; font-weight:bold; }&lt;br /&gt;.dateText { font-size: 9pt; color: white; }&lt;br /&gt;.StatusIconText{ font-size: 9pt; font-weight:bold; }&lt;br /&gt;&lt;br /&gt;/* IRC Style Text */&lt;br /&gt;.txtIrcMe { color:Fuchsia ; }&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Tables&lt;br /&gt;*****************************************************/&lt;br /&gt;.tableBorder /* This is the outline round the main forum tables */&lt;br /&gt;{&lt;br /&gt;   &lt;br /&gt;    /*border: 1px outset; solid*/&lt;br /&gt;    border: 1px outset #42ADF1;&lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.moderationTable /* Moderation table */&lt;br /&gt;{&lt;br /&gt;    border: 1px #FFFFFF solid; &lt;br /&gt;    background-color: #F1F1F1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.adminTable /* Admin table */&lt;br /&gt;{&lt;br /&gt;    border: 1px #1C84D0 solid;&lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.quoteTable { /* This is the quote table, where quotes from previous posts are shown */&lt;br /&gt;    border:1px inset;&lt;br /&gt;    background-color: #EEF7FF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.editTable { /* This is the edit notes table, shown when someone has edited a post, and this feature is enabled */&lt;br /&gt;    border: 1px inset; &lt;br /&gt;    color: Red;&lt;br /&gt;    background-color: #EEF7FF;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Table Header and cell definitions&lt;br /&gt;*****************************************************/&lt;br /&gt;td.column /* td.column is the main heading row of the table, shows either the table title, or the column headings, such as 'Posts', 'Last Post' etc. Top row of all tables. */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold; &lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #78ABDE; &lt;br /&gt;    background-image: url(../images/bg_th.gif); &lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;    COLOR: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.h1a /* td.h1a is the subheading row of the table, shows the names of Forum Groups on main page, or 'Announcements', 'Topics' on ShowForum page */&lt;br /&gt;{&lt;br /&gt;    color: #4455aa;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    background-image: url(../images/forumHeaderBackgroundAlternate.gif);&lt;br /&gt;    background-color: #E7E3E7;&lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.h1 /* td.h1 was the old subheading row of the table. This should probably be deleted as I don't think it is used anymore. */&lt;br /&gt;{&lt;br /&gt;    color: white;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;    background-image: url(../images/forumHeaderBackground.gif);&lt;br /&gt;    background-color: #4455aa&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.f /* Forums column cells on main page; last post, replies, view cells on ShowForums page (shaded cells?) */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt; border-top: 0px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;td.f1 &lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF;&lt;br /&gt; border-top: 1px solid #53A3E2;&lt;br /&gt; border-right: 1px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;td.f2&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.fh&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF; &lt;br /&gt;    /*background-image: url(../images/fhBg.gif); */&lt;br /&gt;    background-image: url(../images/fhBg.gif);&lt;br /&gt;    background-repeat: repeat-x;&lt;br /&gt;}&lt;br /&gt;td.fh1 &lt;br /&gt;{&lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #FFFFFF; &lt;br /&gt;    /*background-image: url(../images/fhBg.gif); */&lt;br /&gt;    background-image: url(../images/hdr_bg.gif);&lt;br /&gt;    background-repeat: repeat-x;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh2 /* used in Forums Statistics box to control size of text*/&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3b /* TD.fh3 is Threads, Posts cells on main table, Thread cells on ShowForum page (not shaded?) */ &lt;br /&gt;&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3 /* TD.fh3 is Threads, Posts cells on main table, Thread cells on ShowForum page (not shaded?) */ &lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #53A3E2;&lt;br /&gt; border-left: 1px solid #53A3E2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh3a /* TD.fh3a is Alternating table for Post Body in the PostView */ &lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #F6FBFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TD.fh4 /* TD.fh4 is Last Post cells on main table (not shaded?) */&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt; border-top: 1px solid #DDEEFF;&lt;br /&gt; border-left: 1px solid #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Background color and text used in threaded view&lt;br /&gt;*****************************************************/&lt;br /&gt;td.threadTitle&lt;br /&gt;{&lt;br /&gt;    background-color: #D4D9EC;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.threadDetailTextSmall&lt;br /&gt;{&lt;br /&gt;    color: #0055E7;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.threadDetailTextSmallBold&lt;br /&gt;{&lt;br /&gt;    color: #0055E7;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;}&lt;br /&gt;TD&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a, a:visited, a:link &lt;br /&gt;{&lt;br /&gt;    color: #013DA4;&lt;br /&gt;    text-decoration: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a:Hover /* General page anchors */&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;    text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold, a.linkMenuSink &lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmall, a.LinkSmallBold, a.linkMenuSink&lt;br /&gt;{&lt;br /&gt;    color: navy;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold:visited, a.linkMenuSink:visited&lt;br /&gt;{&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.linkSmallBold:Hover, a.linkMenuSink:Hover&lt;br /&gt;{&lt;br /&gt;/* color: #DD6900; */&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk3, a.lnk3:visited, a.lnk3:link&lt;br /&gt;{&lt;br /&gt; font-size: 9pt; &lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk3:Hover&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;    text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Text and links used in ForumGroupRepeater and ForumRepeater&lt;br /&gt;*****************************************************/&lt;br /&gt;columnText, a.columnText, a.columnText:visited, a.columnText:link &lt;br /&gt;{  &lt;br /&gt; font-size: 9pt; &lt;br /&gt; color: white; &lt;br /&gt; font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.columnText:hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.column:visited, a.column:link, a.column:hover&lt;br /&gt;{&lt;br /&gt;    color: white;&lt;br /&gt;    font-weight:bold;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.flnk3&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.flnk3:visited, a.flnk3:link&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.flnk3:hover&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.inlineLink /* Username in ShowPost, next to online status */&lt;br /&gt;{&lt;br /&gt;  cursor:pointer;&lt;br /&gt;  color: #555555;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.inline &lt;br /&gt;{&lt;br /&gt;  font-size: 9pt;&lt;br /&gt;  color: #555555;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Text and Anchor to display when a user is online&lt;br /&gt;*****************************************************/&lt;br /&gt;&lt;br /&gt;.userOnlineLink, a.userOnlineLink, a.userOnlineLink:Visited, a.userOnlineLink:Link&lt;br /&gt;/* text style to show when a user is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    color: #013DA4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.userOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.moderatorOnlineLinkBold, a.moderatorOnlineLinkBold, a.moderatorOnlineLinkBold:Visited, a.moderatorOnlineLinkBold:Link&lt;br /&gt;/* text style to show when a moderator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 044AC4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.moderatorOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.supermoderatorOnlineLinkBold, a.supermoderatorOnlineLinkBold, a.supermoderatorOnlineLinkBold:Visited, a.supermoderatorOnlineLinkBold:Link&lt;br /&gt;/* text style to show when a moderator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 0352DC;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.supermoderatorOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.adminOnlineLinkBold, a.adminOnlineLinkBold, a.adminOnlineLinkBold:Visited, a.adminOnlineLinkBold:Link&lt;br /&gt;/* text style to show when an administrator is online */&lt;br /&gt;{&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: 035FFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.adminOnlineLinkBold:Hover&lt;br /&gt;{&lt;br /&gt; color: #FF3300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Navigation: Text and anchors used in the navigation menu&lt;br /&gt;*****************************************************/&lt;br /&gt;.menuText /* Font used for navigation menu */&lt;br /&gt;{&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: bold;&lt;br /&gt;    color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.menuLink:visited, a.menuLink:link /* Font used for links in the navigation menu */&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt; font-weight: normal;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    color: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.menuLink:Hover /* Font used for hovering over a link in the navigation menu */&lt;br /&gt;{&lt;br /&gt;    color: #FF3300;&lt;br /&gt;}&lt;br /&gt;.menuLink&lt;br /&gt;{&lt;br /&gt; font-size: 9pt;&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    color: #FFFFFF;&lt;br /&gt;}&lt;br /&gt;td.menuBg &lt;br /&gt;{&lt;br /&gt;     background-color: #DDEEFF;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Default separator style for PostList&lt;br /&gt;*****************************************************/&lt;br /&gt;td.flatViewSpacing /* Separates Users from Guests in WhoIsOnline page */&lt;br /&gt;{&lt;br /&gt; height: 2px; &lt;br /&gt; background-color: #80B7FF; &lt;br /&gt;} &lt;br /&gt;td.threadSeparator /* Separates posts in ShowPost page */&lt;br /&gt;{&lt;br /&gt; height: 4px; &lt;br /&gt; background-color: #79ABDE; &lt;br /&gt;} &lt;br /&gt;td.adminSeparator /* Separates 'groups of options' in Admin Nav Bar */&lt;br /&gt;{&lt;br /&gt; height: 4px; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt;} &lt;br /&gt;td.moderateSeparator /* Separator in ModerateForum page */&lt;br /&gt;{&lt;br /&gt; height: 12px; &lt;br /&gt; background-color: #FFFFFF; &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Validation Text&lt;br /&gt;*****************************************************/&lt;br /&gt;.validationWarning &lt;br /&gt;{&lt;br /&gt; color: Red; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Page control selected page&lt;br /&gt;*****************************************************/&lt;br /&gt;.currentPage &lt;br /&gt;{&lt;br /&gt; font-size : 12pt; &lt;br /&gt; font-weight:bold; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Form Elements&lt;br /&gt;*****************************************************/&lt;br /&gt;select /* drop down lists in forms */&lt;br /&gt;{&lt;br /&gt;    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;textarea /* large multi-line text boxes in forms */&lt;br /&gt;{&lt;br /&gt;    font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;input /* input elements in forms, e.g radio buttons, text boxes, etc. */&lt;br /&gt;{&lt;br /&gt;    font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*****************************************************&lt;br /&gt;Control Panel&lt;br /&gt;*****************************************************/&lt;br /&gt;td.ControlPanelTabActive &lt;br /&gt;{&lt;br /&gt;    font-weight: bold; &lt;br /&gt;    font-size: 9pt; &lt;br /&gt;    background-color: #78ABDE; &lt;br /&gt;    background-image: url(../images/forumColumnBackground.gif); &lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;    COLOR: white;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.ControlPanelTabInactive &lt;br /&gt;{&lt;br /&gt; color: #4455aa;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;    font-weight: normal;&lt;br /&gt;    text-decoration: none; &lt;br /&gt;    background-image: url(../images/forumHeaderBackgroundAlternate.gif);&lt;br /&gt;    background-color: #E7E3E7;&lt;br /&gt;    background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;td.ControlPanelTabLine&lt;br /&gt;{&lt;br /&gt; background-color: #7AACE0;&lt;br /&gt;}&lt;br /&gt;td.border_left { &lt;br /&gt; background-image: url(../images/border_left.gif); &lt;br /&gt; width: 10px; &lt;br /&gt;}&lt;br /&gt;td.border_right { &lt;br /&gt; background-image: url(../images/border_right.gif); &lt;br /&gt; width: 10px;&lt;br /&gt;}&lt;br /&gt;td.logo_bg { &lt;br /&gt; background-image: url(../images/logo_bg.gif); &lt;br /&gt; background-repeat: repeat-x; &lt;br /&gt;}&lt;br /&gt;#content { &lt;br /&gt; text-align: left; &lt;br /&gt;  width: 100%;&lt;br /&gt; margin: 5px;&lt;br /&gt; width: auto;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.QuickPostText&lt;br /&gt;{&lt;br /&gt; color: red;&lt;br /&gt;    font-size: 9pt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk4, a.lnk4:visited, a.lnk4:link &lt;br /&gt;{ &lt;br /&gt; font-size: 9pt;&lt;br /&gt; color: #A3A3A3;&lt;br /&gt; font-weight: bold; &lt;br /&gt;}&lt;br /&gt;a.lnk4:Hover &lt;br /&gt;{ &lt;br /&gt; color: #FF3300; &lt;br /&gt; text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a.lnk5, a.lnk5:visited, a.lnk5:link &lt;br /&gt;{ &lt;br /&gt; font-size: 9pt;&lt;br /&gt; color: #F67340;&lt;br /&gt; font-weight: bold; &lt;br /&gt;}&lt;br /&gt;a.lnk5:Hover &lt;br /&gt;{ &lt;br /&gt; color: #F64D0B; &lt;br /&gt; text-decoration: underline;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;--&gt;&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Single Sign-On (SSO) is a hot topic these days. Most clients I  worked with have more than one web application running under different  versions of .NET framework in different subdomains, or even in  different domains and they want to let the user login once and stay  logged in when switching to a different web site. Today we will  implement SSO and see if we can make it work in different scenarios. We  will start with a simple case and gradually build upon it:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;SSO for parent and child application in the virtual sub-directory &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;SSO using different authorization credentials (username mapping) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;SSO for two applications in two sub-domains of the same domain &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;SSO when applications run under different versions of .NET &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;SSO for two applications in different domains. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;SSO for mixed-mode authentication (Forms and Windows)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;1. SSO for parent and child application in the virtual sub-directory&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Lets  assume that we have two .NET applications - Foo and Bar, and Bar is  running in a virtual sub-directory of Foo (http://foo.com/bar). Both  applications implement Forms authentication. Implementation of Forms  authentication requires you to override the  Application_AuthenticateRequest, where you perform the authentication  and upon successful authentication, call  FormsAuthentication.RedirectFromLoginPage, passing in the logged-in  user name (or any other piece of information that identifies the user  in the system) as a parameter. In ASP.NET the logged-in user status  is persisted by storing the cookie on the client computer. When you  call RedirectFromLoginPage, a cookie is created which contains an  encrypted FormsAuthenticationTicket with the name of the logged-in user  . There is a section in web.config that defines how the cookie is  created:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  &amp;lt;forms name=&amp;quot;.FooAuth&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;60&amp;quot; loginUrl=&amp;quot;login.aspx&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  &amp;lt;forms name=&amp;quot;.BarAuth&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;60&amp;quot; loginUrl=&amp;quot;login.aspx&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The important attributes here are &lt;strong&gt;name&lt;/strong&gt; and &lt;strong&gt;protection. &lt;/strong&gt;If  you make them match for both Foo and Bar applications, they will both  write and read the same cookie using the same protection level,  effectively providing SSO:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  &amp;lt;forms name=&amp;quot;.SSOAuth&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;60&amp;quot; loginUrl=&amp;quot;login.aspx&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When  protection attribute is set to &amp;quot;All&amp;quot;, both encryption and validation  (via hash) is applied to the cookie. The default validation and  encryption keys are stored in the machine.config file and can be  overridden in the application’s web.config file. The default value is  this:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;machineKey validationKey=&amp;quot;AutoGenerate,IsolateApps&amp;quot; decryptionKey=&amp;quot; AutoGenerate,IsolateApps&amp;quot; validation=&amp;quot;SHA1&amp;quot; /&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;IsolateApps  means that a different key will be generated for every application. We  can’t have that. In order for the cookie to be encrypted and decrypted  with the same key in all applications either remove the IsolateApps  option or better yet, add the same concrete key to the web.config of  all applications using SSO:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;machineKey validationKey=&amp;quot;F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902&amp;quot; decryptionKey=&amp;quot;F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902F8D923AC&amp;quot; validation=&amp;quot;SHA1&amp;quot; /&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you are authenticating against the same users store, this is all it takes – a few changes to the web.config files. &lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;2. SSO using different authorization credentials (username mapping)&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;But  what if the Foo application authenticates against its own database and  the Bar application uses Membership API or some other form of  authentication? In this case the automatic cookie that is created on  the Foo is not going to be any good for the Bar, since it will contain  the user name that makes no sense to the Bar. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;To make it work,  you will need to create the second authentication cookie especially for  the Bar application. You will also need a way to map the Foo user to  the Bar user. Lets assume that you have a user &amp;quot;John Doe&amp;quot; logging in to  the Foo application and you determined that this user is identified as  &amp;quot;johnd&amp;quot; in the Bar application. In the Foo authentication method you  will add the following code:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, &amp;quot;johnd&amp;quot;, DateTime.Now, DateTime.Now.AddYears(1), true, &amp;quot;&amp;quot;);&lt;br /&gt;&lt;br /&gt;  HttpCookie cookie = new HttpCookie(&amp;quot;.BarAuth&amp;quot;);&lt;br /&gt;&lt;br /&gt;  cookie.Value = FormsAuthentication.Encrypt(fat);&lt;br /&gt;&lt;br /&gt;  cookie.Expires = fat.Expiration;&lt;br /&gt;&lt;br /&gt;  HttpContext.Current.Response.Cookies.Add(cookie);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthentication.RedirectFromLoginPage(&amp;quot;John Doe&amp;quot;);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;User  names are hard-coded for demonstration purposes only. This code snippet  creates the FormsAuthenticationTicket for the Bar application and  stuffs it with the user name that makes sense in the context of the Bar  application. And then it calls RedirectFromLoginPage to create the  correct authentication cookie for the Foo application. If you changed  the name of forms authentication cookie to be the same for both  applications (see our previous example), make sure that they are  different now, since we are not using the same cookie for both sites  anymore:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  &amp;lt;forms name=&amp;quot;.FooAuth&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;60&amp;quot; loginUrl=&amp;quot;login.aspx&amp;quot; slidingExpiration=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  &amp;lt;forms name=&amp;quot;.BarAuth&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;60&amp;quot; loginUrl=&amp;quot;login.aspx&amp;quot; slidingExpiration=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now  when the user is logged in to Foo, he is mapped to the Bar user and the  Bar authentication ticket is created along with the Foo authentication  ticket. If you want it to work in the reverse direction, add similar  code to the Bar application:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, &amp;quot;John Doe&amp;quot;, DateTime.Now, DateTime.Now.AddYears(1), true, &amp;quot;&amp;quot;);&lt;br /&gt;&lt;br /&gt;  HttpCookie cookie = new HttpCookie(&amp;quot;.FooAuth&amp;quot;);&lt;br /&gt;&lt;br /&gt;  cookie.Value = FormsAuthentication.Encrypt(fat);&lt;br /&gt;&lt;br /&gt;  cookie.Expires = fat.Expiration;&lt;br /&gt;&lt;br /&gt;  HttpContext.Current.Response.Cookies.Add(cookie);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthentication.RedirectFromLoginPage(&amp;quot;johnd&amp;quot;);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Also  make sure that you have the &amp;lt;machineKey&amp;gt; element in web.config of  both applications with matching validation and encryption keys.&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;3. SSO for two applications in two sub-domains of the same domain&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;Now  what if Foo and Bar are configured to run under different domains  http://foo.com and http://bar.foo.com. The code above will not work  because the cookies will be stored in different files and will not be  visible to both applications. In order to make it work, we will need to  create domain-level cookies that are visible to all sub-domains. We  can’t use RedirectFromLoginPage method anymore, since it doesn’t have  the flexibility to create a domain-level cookie. So we do it manually:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, &amp;quot;johnd&amp;quot;, DateTime.Now, DateTime.Now.AddYears(1), true, &amp;quot;&amp;quot;);&lt;br /&gt;&lt;br /&gt;  HttpCookie cookie = new HttpCookie(&amp;quot;.BarAuth&amp;quot;);&lt;br /&gt;&lt;br /&gt;  cookie.Value = FormsAuthentication.Encrypt(fat);&lt;br /&gt;&lt;br /&gt;  cookie.Expires = fat.Expiration;&lt;br /&gt;&lt;br /&gt;  cookie.Domain = &amp;quot;.foo.com&amp;quot;;&lt;br /&gt;&lt;br /&gt;  HttpContext.Current.Response.Cookies.Add(cookie);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, &amp;quot;John Doe&amp;quot;, DateTime.Now, DateTime.Now.AddYears(1), true, &amp;quot;&amp;quot;);&lt;br /&gt;&lt;br /&gt;  HttpCookie cookie = new HttpCookie(&amp;quot;.FooAuth&amp;quot;);&lt;br /&gt;&lt;br /&gt;  cookie.Value = FormsAuthentication.Encrypt(fat);&lt;br /&gt;&lt;br /&gt;  cookie.Expires = fat.Expiration;&lt;br /&gt;&lt;br /&gt;  cookie.Domain = &amp;quot;.foo.com&amp;quot;;&lt;br /&gt;&lt;br /&gt;  HttpContext.Current.Response.Cookies.Add(cookie);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Note  the highlighted lines. By explicitly setting the cookie domain to  &amp;quot;.foo.com&amp;quot; we ensure that this cookie will be visible in both  http://foo.com and http://bar.foo.com or any other sub-domain. You can  also specifically set the Bar authentication cookie domain to  &amp;quot;bar.foo.com&amp;quot;. It is more secure, since other sub-domains can’t see it  now. Also notice that RFC 2109 requires two periods in the cookie  domain value, therefore we add a period in the front – &amp;quot;.foo.com&amp;quot;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Again,  make sure that you have the same &amp;lt;machineKey&amp;gt; element in  web.config of both applications. There is only one exception to this  rule and it is explained in the next secion.&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;4. SSO when applications run under different versions of .NET&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;It  is possible that Foo and Bar applications run under different version  of .NET. In this case the above examples will not work. It turns out  that ASP.NET 2.0 is using a different encryption method for  authorization tickets. In ASP.NET 1.1 it was 3DES, in ASP.NET 2.0 it is  AES. Fortunately, a new attribute was introduced in ASP.NET 2.0 for  backwards compatibility&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;machineKey validationKey=&amp;quot;F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902&amp;quot; decryptionKey=&amp;quot;F9D1A2D3E1D3E2F7B3D9F90FF3965ABDAC304902F8D923AC&amp;quot; validation=&amp;quot;SHA1&amp;quot; decryption=&amp;quot;3DES&amp;quot; /&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Setting decryption=&amp;quot;3DES&amp;quot; will  make ASP.NET 2.0 use the old encryption method, making the cookies  compatible again. Don’t try to add this attribute to the web.config of  the ASP.NET 1.1 application. It will cause an error.&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;5. SSO for two applications in different domains.&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;We’ve  been quite successful creating shared authentication cookies so far,  but what if Foo and Bar are in different domains – http://foo.com and  http://bar.com? They cannot possibly share a cookie or create a second  cookie for each other. In this case each site will need to create its  own cookies, and call the other site to verify if the user is logged in  elsewhere. One way to do it is via a series of redirects.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In  order to achieve that, we will create a special page (we’ll call it  sso.aspx) on both web sites. The purpose of this page is to check if  the cookie exists in its domain and return the logged in user name, so  that the other application can create a similar cookie in its own  domain. This is the sso.aspx from Bar.com:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; %&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;script language=&amp;quot;C#&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;void Page_Load()&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;// this is our caller, we will need to redirect back to it eventually  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;UriBuilder uri = new UriBuilder(Request.UrlReferrer);   &lt;/p&gt;&lt;br /&gt;&lt;p&gt;   HttpCookie c = HttpContext.Current.Request.Cookies[&amp;quot;.BarAuth&amp;quot;];&lt;/p&gt;&lt;br /&gt;&lt;p&gt;   if (c != null &amp;amp;&amp;amp; c.HasKeys) // the cookie exists!&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;try  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;{  &lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;string cookie = HttpContext.Current.Server.UrlDecode(c.Value);  &lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;FormsAuthenticationTicket fat = FormsAuthentication.Decrypt(cookie);           &lt;/p&gt;&lt;br /&gt;&lt;p&gt;         uri.Query = uri.Query + &amp;quot;&amp;amp;ssoauth=&amp;quot; + fat.Name; // add logged-in user name to the query&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;catch  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;{  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;Response.Redirect(uri.ToString()); // redirect back to the caller  &lt;br /&gt;&lt;br /&gt;  } &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This  page always redirects back to the caller. If the authentication cookie  exists on Bar.com, it is decrypted and the user name is passed back in  the query string parameter &lt;em&gt;ssoauth&lt;/em&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;On the other end  (Foo.com), we need to insert some code into the http request processing  pipeline. It can be in Application_BeginRequest event or in a custom  HttpHandler or HttpModule. The idea is to intercept all page requests  to Foo.com as early as possible to verify if authentication cookie  exists:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. If authentication cookie exists on Foo.com, continue processing the request. User is logged in on Foo.com&lt;br /&gt;&lt;br /&gt;  2. If authentication cookie doesn’t exist, redirect to Bar.com/sso.aspx.&lt;br /&gt;&lt;br /&gt;  3.  If the current request is the redirect back from Bar.com/sso.aspx,  analyse the ssoauth parameter and create an authentication cookie if  necessary.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It looks pretty simple, but we have to watch out for infinite loops:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;// see if the user is logged in&lt;br /&gt;&lt;br /&gt;  HttpCookie c = HttpContext.Current.Request.Cookies[&amp;quot;.FooAuth&amp;quot;];&lt;/p&gt;&lt;br /&gt;&lt;p&gt;if (c != null &amp;amp;&amp;amp; c.HasKeys) // the cookie exists!&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;try  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;{  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;string cookie = HttpContext.Current.Server.UrlDecode(c.Value);  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;FormsAuthenticationTicket fat = FormsAuthentication.Decrypt(cookie);  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;return; // cookie decrypts successfully, continue processing the page  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;catch  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;{  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;// the authentication cookie doesn't exist - ask Bar.com if the user is logged in there&lt;br /&gt;&lt;br /&gt;  UriBuilder uri = new UriBuilder(Request.UrlReferrer);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;if (uri.Host != &amp;quot;bar.com&amp;quot; || uri.Path != &amp;quot;/sso.aspx&amp;quot;) // prevent infinite loop&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;Response.Redirect(  &lt;a href="http://bar.com/sso.aspx"&gt;&lt;u&gt;http://bar.com/sso.aspx&lt;/u&gt;&lt;/a&gt;);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  else&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;// we are here because the request we are processing is actually a response from bar.com  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;   if (Request.QueryString[&amp;quot;ssoauth&amp;quot;] == null)&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;// Bar.com also didn't have the authentication cookie  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;return; // continue normally, this user is not logged-in   &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;} else  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;{  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;      // user is logged in to Bar.com and we got his name!&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;  string userName = (string)Request.QueryString[&amp;quot;ssoauth&amp;quot;];&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;// let's create a cookie with the same name  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddYears(1), true,   &amp;quot;&amp;quot;);&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;HttpCookie cookie = new HttpCookie(  &amp;quot;.FooAuth&amp;quot;);&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;cookie.Value = FormsAuthentication.Encrypt(fat);  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;cookie.Expires = fat.Expiration;  &lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;HttpContext.Current.Response.Cookies.Add(cookie);  &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The  same code should be placed on both sites, just make sure you are using  correct cookie names (.FooAuth vs. .BarAuth) on each site. Since the  cookie is not actually shared, the applications can have different  &amp;lt;machineKey&amp;gt; elements. It is not necessary to synchronize the  encryption and validation keys. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Some of us may cringe at the  security implications of passing the user name in the query string. A  couple of things can be done to protect it. First of all we are  checking the referrer and we will not accept the ssoauth parameter from  any source other then bar.com/sso.aspx (or foo.com/ssp.aspx). Secondly,  the name can easily be encrypted with a shared key. If Foo and Bar are  using different authentication mechanisms, additional user information  (e.g. e-mail address) can be passed along similarly.&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;6. SSO for mixed-mode authentication (Forms and Windows)&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;So  far we have dealt with Forms authentication only. But what if we want  to authenticate Internet users via Forms authentication first and if it  fails, check if the Intranet user is authenticated on the NT domain? In  theory we can check the following parameter to see if there is a  Windows logon associated with the request: &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Request.ServerVariables[&amp;quot;LOGON_USER&amp;quot;]&lt;/p&gt;&lt;br /&gt;&lt;p&gt;However,  unless our site has Anonymous Access disabled, this value is always  empty. We can disable Anonymous Access and enable Integrate Windows  Authentication for our site in the IIS control panel. Now the  LOGON_USER value contains the NT domain name of the logged in Intranet  user. But all Internet users get challenged for the Windows login name  and password. Not cool. We need to be able to let the Internet users  login via Forms authentication and if it fails, check their Windows  domain credentials.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;One way to solve this problem is to have a  special entry page for Intranet users that has Integrate Windows  Authentication enabled, validates the domain user, creates a Forms  cookie and redirects to the main web site. We can even conceal the fact  that Intranet users are hitting a different page by making a  Server.Transfer. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;There is also an easier solution. It works  because of the way IIS handles the authentication process. If anonymous  access is enabled for a web site, IIS is passing requests right through  to the ASP.NET runtime. It doesn’t attempt to perform any kind of  authentication. However, if the request results in an authentication  error (401), IIS will attempt an alternative authentication method  specified for this site. You need to enable both Anonymous Access and  Integrated Windows Authentication and execute the following code if  Forms authentication fails:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;if (System.Web.HttpContext.Current.Request.ServerVariables[&amp;quot;LOGON_USER&amp;quot;] == &amp;quot;&amp;quot;) { &lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;  System.Web.HttpContext.Current.Response.StatusCode = 401; &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;System.Web.HttpContext.Current.Response.End();   &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  else &lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;// Request.ServerVariables[  &amp;quot;LOGON_USER&amp;quot;] has a valid domain user now!&lt;br /&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When  this code executes, it will check the domain user and will get an empty  string initially. It will then terminate the current request and return  the authentication error (401) to IIS. This will make the IIS use the  alternative authentication mechanism, which in our case is Integrated  Windows Authentication. If the user is already logged in to the domain,  the request will be repeated, now with the NT domain user information  filled-in. If the user is not logged in to the domain, he will be  challenged for the Windows name/password up to 3 times. If the user  cannot login after the third attempt, he will get the 403 error (access  denied).&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;We have examined various  scenarios of Single Sign-On for two ASP.NET applications. It is also  quite possible to implement SSO for heterogeneous systems spawning  across different platforms. Ideas remain the same, but the  implementation may require some creative thinking.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-115649742747658372?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/115649742747658372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=115649742747658372' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115649742747658372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115649742747658372'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2006/08/aspnet-single-sign-on.html' title='ASP.NET Single Sign On'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-115509432499602096</id><published>2006-08-09T11:31:00.000+08:00</published><updated>2006-08-09T11:32:05.333+08:00</updated><title type='text'>ThinkPad X32 can't run IPCONFIG</title><content type='html'>* ThinkPad X32 can't run IPCONFIG&lt;br /&gt;    * When running ipconfig in the command line, an error message appeared as follow&lt;br /&gt;   &lt;br /&gt;   c:\ipconfig /all&lt;br /&gt;    Windows IP Configuration&lt;br /&gt;    An internal error occurred: A device attached to the system is not&lt;br /&gt;    functioning.&lt;br /&gt;    Please contact Microsoft Product Support Services for further help.&lt;br /&gt;    Additional information: Unknown media status code.&lt;br /&gt;   &lt;br /&gt;    Solution:&lt;br /&gt;    http://support.microsoft.com/default.aspx?scid=kb;en-us;239924&lt;br /&gt;    1.    Use Registry Editor (Regedt32.exe) to view the following key in the registry:&lt;br /&gt;    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters&lt;br /&gt;    Add the following registry value:&lt;br /&gt;    Value Name: DisableDHCPMediaSense&lt;br /&gt;    Data Type: REG_DWORD -Boolean&lt;br /&gt;    Value Data Range: 0, 1 (False, True) Default: 0 (False)&lt;br /&gt;    Description: This parameter controls DHCP Media Sense behavior. If you set this value data to   1, DHCP, and even non-DHCP, clients ignore Media Sense events from the interface. By default, Media Sense events trigger the DHCP client to take an action, such as attempting to obtain a lease (when a connect event occurs), or invalidating the interface and routes (when a disconnect event occurs).&lt;br /&gt;    2.    Restart your computer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-115509432499602096?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/115509432499602096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=115509432499602096' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115509432499602096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/115509432499602096'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2006/08/thinkpad-x32-cant-run-ipconfig.html' title='ThinkPad X32 can&apos;t run IPCONFIG'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-113956603210936444</id><published>2006-02-10T18:05:00.000+08:00</published><updated>2006-02-10T18:07:12.900+08:00</updated><title type='text'>Email validation for PHP</title><content type='html'>Here is the function to validate an email address with PHP.&lt;br /&gt;It will check whether the domain has a valid mx record or not.&lt;br /&gt;&lt;br /&gt;    function validate_email($email)&lt;br /&gt;    {&lt;br /&gt;   &lt;br /&gt;       // regular expression validation for email address&lt;br /&gt;       $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";&lt;br /&gt;&lt;br /&gt;       $valid = 0;&lt;br /&gt;   &lt;br /&gt;       // Validate the syntax&lt;br /&gt;       if (eregi($regexp, $email))&lt;br /&gt;       {&lt;br /&gt;          list($username,$domaintld) = split("@",$email);&lt;br /&gt;          // Validate the domain&lt;br /&gt;          if (getmxrr($domaintld,$mxrecords))&lt;br /&gt;             $valid = 1;&lt;br /&gt;       } else {&lt;br /&gt;          $valid = 0;&lt;br /&gt;       }&lt;br /&gt;   &lt;br /&gt;       return $valid;&lt;br /&gt;   &lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-113956603210936444?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/113956603210936444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=113956603210936444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113956603210936444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113956603210936444'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2006/02/email-validation-for-php.html' title='Email validation for PHP'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-113523127829277869</id><published>2005-12-22T13:58:00.000+08:00</published><updated>2005-12-22T14:01:18.606+08:00</updated><title type='text'>Simulate register_globals = on in PHP</title><content type='html'>Add the following lines on the top of your PHP code. This will get a result similar to switching register_globals=on&lt;br /&gt;&lt;br /&gt;foreach($_POST AS $key =&gt; $value) { ${$key} = $value; }&lt;br /&gt;foreach($_GET AS $key =&gt; $value) { ${$key} = $value; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-113523127829277869?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/113523127829277869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=113523127829277869' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113523127829277869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113523127829277869'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/12/simulate-registerglobals-on-in-php.html' title='Simulate register_globals = on in PHP'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-113289234087700957</id><published>2005-11-25T12:18:00.000+08:00</published><updated>2005-11-25T12:19:02.550+08:00</updated><title type='text'>Use multiple submit buttons on one form using PHP</title><content type='html'>&lt;span style="font-size:85%;"&gt;&amp;lt;form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" name="submit" value="NEW" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" name="submit" value="SAVE" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" name="submit" value="EDIT" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;&lt;br /&gt;&lt;p&gt; switch ($_GET['submit']) {&lt;/p&gt;&lt;br /&gt;&lt;p&gt; case 'NEW':&lt;br /&gt;&lt;br /&gt; print 'This is what happens when new button is clicked.';&lt;br /&gt;&lt;br /&gt; break;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; case 'SAVE':&lt;br /&gt;&lt;br /&gt; print 'This is what happens when save button is clicked.';&lt;br /&gt;&lt;br /&gt; break;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; case 'EDIT':&lt;br /&gt;&lt;br /&gt; print 'This is what happens when edit button is clicked.';&lt;br /&gt;&lt;br /&gt; break;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; default:&lt;br /&gt;&lt;br /&gt; print 'You can put the html form here.';&lt;br /&gt;&lt;br /&gt; break;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; } // End: switch ($_GET['submit'])&lt;/p&gt;&lt;br /&gt;&lt;p&gt;?&amp;gt; &lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-113289234087700957?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/113289234087700957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=113289234087700957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113289234087700957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113289234087700957'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/11/use-multiple-submit-buttons-on-one.html' title='Use multiple submit buttons on one form using PHP'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-113289146964679438</id><published>2005-11-25T12:03:00.000+08:00</published><updated>2005-11-25T12:04:29.656+08:00</updated><title type='text'>Multiple submit buttons on a single form using JavaScript</title><content type='html'>&lt;span style="font-size:85%;"&gt;&amp;lt;SCRIPT&amp;gt;&lt;br /&gt;&lt;br /&gt;function submitFunction(i) {&lt;br /&gt;&lt;br /&gt;if (i==1) document.form1.action=&lt;br /&gt;&lt;br /&gt;&amp;quot;http://www.company.com/cgi-bin/cgi1.cgi&amp;quot;;&lt;br /&gt;&lt;br /&gt;if (i==2) document.form1.action=&lt;br /&gt;&lt;br /&gt;&amp;quot;http://www.company.com/cgi-bin/cgi2.cgi&amp;quot;;&lt;br /&gt;&lt;br /&gt;if (i==3) document.form1.action=&lt;br /&gt;&lt;br /&gt;&amp;quot;http://www.company.com/cgi-bin/cgi3.cgi&amp;quot;;&lt;br /&gt;&lt;br /&gt;document.form1.submit()&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&lt;p&gt;&amp;lt;FORM NAME=&amp;quot;form1&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;INPUT TYPE=&amp;quot;button&amp;quot; VALUE=&amp;quot;Submit 1&amp;quot; onClick=&amp;quot;submitFunction(1)&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;INPUT TYPE=&amp;quot;button&amp;quot; VALUE=&amp;quot;Submit 2&amp;quot; onClick=&amp;quot;submitFunction(2)&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;INPUT TYPE=&amp;quot;button&amp;quot; VALUE=&amp;quot;Submit 3&amp;quot; onClick=&amp;quot;submitFunction(3)&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/FORM&amp;gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-113289146964679438?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/113289146964679438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=113289146964679438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113289146964679438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/113289146964679438'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/11/multiple-submit-buttons-on-single-form.html' title='Multiple submit buttons on a single form using JavaScript'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-112114751694699434</id><published>2005-07-12T13:51:00.000+08:00</published><updated>2005-07-12T13:51:56.950+08:00</updated><title type='text'>C# Genrerate Thumbnail Source Code</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;protected void genThumbnailPhoto(string fileName, string path)&lt;br /&gt;        {           &lt;br /&gt;            System.IO.FileInfo info = new System.IO.FileInfo(fileName);&lt;br /&gt;&lt;br /&gt;            using(Bitmap bitmap1 = new Bitmap(fileName, false))&lt;br /&gt;            {&lt;br /&gt;                int i= 0;&lt;br /&gt;                int TWidth;&lt;br /&gt;                int THeight;&lt;br /&gt;                if(bitmap1.Width &gt;= 90 &amp;&amp;amp; bitmap1.Height &gt;=90 )&lt;br /&gt;                {&lt;br /&gt;                    if(bitmap1.Width &gt; bitmap1.Height )&lt;br /&gt;                    {&lt;br /&gt;                        TWidth = 90;&lt;br /&gt;                        i = bitmap1.Width/90;&lt;br /&gt;                        THeight = bitmap1.Height / i;&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                        THeight = 90;&lt;br /&gt;                        i = bitmap1.Height/90;&lt;br /&gt;                        TWidth = bitmap1.Width / i;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    TWidth = bitmap1.Width;&lt;br /&gt;                    THeight = bitmap1.Height;&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;                   &lt;br /&gt;                using(System.Drawing.Image image =&lt;br /&gt;                          System.Drawing.Image.FromFile(fileName))&lt;br /&gt;                using(Bitmap bitmap = new Bitmap(image, TWidth, THeight))&lt;br /&gt;                {&lt;br /&gt;                    bitmap.Save(path + "/t__" + info.Name , image.RawFormat);&lt;br /&gt;                }&lt;br /&gt;           &lt;br /&gt;            }&lt;br /&gt;           &lt;br /&gt;&lt;br /&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-112114751694699434?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/112114751694699434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=112114751694699434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114751694699434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114751694699434'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/07/c-genrerate-thumbnail-source-code.html' title='C# Genrerate Thumbnail Source Code'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-112114043668945339</id><published>2005-07-12T11:52:00.000+08:00</published><updated>2005-07-12T11:53:56.690+08:00</updated><title type='text'>C# Return a web page in a string</title><content type='html'>&lt;span style="font-family: arial;font-size:85%;" &gt;public static string HttpConnection(string strUrl)&lt;br /&gt;        {&lt;br /&gt;            string strResponse = "";&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strUrl);&lt;br /&gt;                System.Net.HttpWebResponse webResponse = (System.Net.HttpWebResponse)webRequest.GetResponse();&lt;br /&gt;                System.Text.Encoding encode = System.Text.Encoding.GetEncoding("big5");&lt;br /&gt;                System.IO.Stream stream = webResponse.GetResponseStream();&lt;br /&gt;                System.IO.StreamReader streamReader = new System.IO.StreamReader(stream, encode);&lt;br /&gt;                strResponse = streamReader.ReadToEnd();&lt;br /&gt;&lt;br /&gt;                //-----release the reader and stream resource-----&lt;br /&gt;                streamReader.Close();&lt;br /&gt;                stream.Close();&lt;br /&gt;            }&lt;br /&gt;            catch(Exception exp)&lt;br /&gt;            {&lt;br /&gt;                throw exp;&lt;br /&gt;            }&lt;br /&gt;            return strResponse;&lt;br /&gt;        }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-112114043668945339?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/112114043668945339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=112114043668945339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114043668945339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114043668945339'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/07/c-return-web-page-in-string.html' title='C# Return a web page in a string'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-112114033298967359</id><published>2005-07-12T11:51:00.000+08:00</published><updated>2005-07-12T11:52:12.993+08:00</updated><title type='text'>C# Get result of a web page with POST variables</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: arial;"&gt;public static string HttpPOSTConnection(string strUrl,string Param)&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;        {&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            string strResponse = "";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            try&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            {&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                string postData = Param;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                byte[]  byte1=System.Text.Encoding.Default.GetBytes(postData);&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                // Set the content type of the data being posted.&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strUrl);&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                webRequest.Method = "POST";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                webRequest.ContentType="application/x-www-form-urlencoded";&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                // Set the content length of the string being posted.&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                webRequest.ContentLength=byte1.Length;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.IO.Stream newStream=webRequest.GetRequestStream();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                newStream.Write(byte1,0,byte1.Length);&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.Net.HttpWebResponse webResponse = (System.Net.HttpWebResponse)webRequest.GetResponse();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.Text.Encoding encode = System.Text.Encoding.GetEncoding("big5");&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.IO.Stream stream = webResponse.GetResponseStream();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                System.IO.StreamReader streamReader = new System.IO.StreamReader(stream, System.Text.Encoding.Default);&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                strResponse = streamReader.ReadToEnd();&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;                //-----release the reader and stream resource-----&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                newStream.Close();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                streamReader.Close();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                stream.Close();&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            }&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            catch(Exception exp)&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            {&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;                throw exp;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            }&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;            return strResponse;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-family: arial;"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-112114033298967359?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/112114033298967359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=112114033298967359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114033298967359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114033298967359'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/07/c-get-result-of-web-page-with-post.html' title='C# Get result of a web page with POST variables'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-112114012234350022</id><published>2005-07-12T11:48:00.000+08:00</published><updated>2005-07-12T12:03:33.393+08:00</updated><title type='text'>C#  Send mail, send web page by email</title><content type='html'>&lt;span style=";font-family:arial;font-size:85%;"  &gt;using System;&lt;br /&gt;using System.Web.Mail;&lt;br /&gt;&lt;br /&gt;namespace NEWS_RANK.util.net&lt;br /&gt;{&lt;br /&gt;&lt;summary&gt;&lt;/summary&gt;&lt;br /&gt;  public class Mail&lt;br /&gt;  {&lt;br /&gt;      private static string smtpserver = "127.0.0.1";&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        public static void sendMail(string To, string From, string Subject, string Body)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            {               &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                //-----Mail properties----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                MailMessage mMessage = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.From = From;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.To = To;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.Subject = Subject;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.Body = Body;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.BodyFormat = MailFormat.Html;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                //-----Mail Send-----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                SmtpMail.SmtpServer = smtpserver;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                SmtpMail.Send(mMessage);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            catch(Exception exp)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                throw exp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; public static void sendMailHttpUrl(string To, string From, string Subject, string HttpUrl,string Query,string HttpMethod)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            {               &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                //-----Mail properties------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                MailMessage mMessage = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.From = From;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.To = To;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.Subject = Subject;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                string mailContent = "";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                if( HttpMethod != null &amp;&amp;amp; HttpMethod.ToLower().Equals("post") )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    Uri baseUri = new Uri(HttpUrl);               &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    string path = baseUri.GetLeftPart(System.UriPartial.Path);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    string param = "";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    if( Query != null &amp;&amp;amp;amp;amp; Query.Length &gt; 1 )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                        param = Query;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                    mailContent = HttpUtil.HttpPOSTConnection(path,param);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                else mailContent = HttpUtil.HttpConnection(HttpUrl);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.Body = mailContent;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                mMessage.BodyFormat = MailFormat.Html;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                //-----Mail Send-----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                SmtpMail.SmtpServer = smtpserver;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                SmtpMail.Send(mMessage);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            catch(Exception exp)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;                throw exp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-112114012234350022?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/112114012234350022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=112114012234350022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114012234350022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112114012234350022'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/07/c-send-mail-send-web-page-by-email.html' title='C#  Send mail, send web page by email'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-112113991891350626</id><published>2005-07-12T11:44:00.000+08:00</published><updated>2005-07-12T11:45:18.920+08:00</updated><title type='text'>Saving a web page to a file using C#</title><content type='html'>&lt;span style="font-family: arial;font-size:85%;" &gt;public static void HttpConnectionSaveToFile(string strUrl,string SavedPath)&lt;br /&gt;        {&lt;br /&gt;            System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strUrl);&lt;br /&gt;            System.Net.HttpWebResponse webResponse = (System.Net.HttpWebResponse)webRequest.GetResponse();&lt;br /&gt;            System.IO.Stream stream = webResponse.GetResponseStream();&lt;br /&gt;            System.IO.BinaryReader streamReader = new System.IO.BinaryReader(stream);&lt;br /&gt;            byte[] b = streamReader.ReadBytes((int)webResponse.ContentLength);&lt;br /&gt;            //-----release the reader and stream resource-----&lt;br /&gt;            if (System.IO.File.Exists(SavedPath))&lt;br /&gt;            {&lt;br /&gt;                //Console.WriteLine("{0} already exists!", SavedPath);&lt;br /&gt;                System.IO.File.Delete(SavedPath);&lt;br /&gt;            }&lt;br /&gt;            System.IO.FileStream fs = new System.IO.FileStream(SavedPath, System.IO.FileMode.CreateNew);&lt;br /&gt;            // Create the writer for data.&lt;br /&gt;            System.IO.BinaryWriter w = new System.IO.BinaryWriter(fs);&lt;br /&gt;            // Write data to Test.data.&lt;br /&gt;            w.Write( b );&lt;br /&gt;            w.Close();&lt;br /&gt;            fs.Close();&lt;br /&gt;&lt;br /&gt;            streamReader.Close();&lt;br /&gt;            stream.Close();&lt;br /&gt;        }&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-112113991891350626?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/112113991891350626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=112113991891350626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112113991891350626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/112113991891350626'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/07/saving-web-page-to-file-using-c.html' title='Saving a web page to a file using C#'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-111046068984518834</id><published>2005-03-10T20:37:00.000+08:00</published><updated>2005-03-10T21:18:09.850+08:00</updated><title type='text'>SpAcDaemon Virus</title><content type='html'>Today I was kind of doing some house keeping job on my computer.&lt;br /&gt;To my supprise, when I went to My Computer -&gt; System Properties,&lt;br /&gt;I was looking at a picture of Bart Simpson and some weird info&lt;br /&gt;like this:&lt;br /&gt;&lt;br /&gt;Manufactured and supported by:&lt;br /&gt;SPAC&lt;br /&gt;thespacdude@yahoo.com&lt;br /&gt;&lt;br /&gt;and when I clicked on Support Information, it shows:&lt;br /&gt;&lt;br /&gt;SPAC&lt;br /&gt;ERROR: Water detected in the BIOS.&lt;br /&gt;&lt;br /&gt;Something wonderful has happened,&lt;br /&gt;your computer is alive......&lt;br /&gt;&lt;br /&gt;I googled it, I also tried McFee, Symantec, MS AntiSpyware, Adware, SpyBot, F-Secure, etc.&lt;br /&gt;But none would detect any virus or trojans in my computer.&lt;br /&gt;There're 2 strange behavior on my computer recently.&lt;br /&gt;1. At Windows Startup, it plays some weird sound... you hear someone laughing.&lt;br /&gt;2. It changed my OEM information, so I saw "Manufactured and supported by: SPAC"&lt;br /&gt;&lt;br /&gt;After about 3 hours of digging thru my registry and system files, I found it.&lt;br /&gt;The file is c:\windows\mssreprc.exe&lt;br /&gt;also it creates a registry key&lt;br /&gt;&lt;br /&gt;Name:SpAcDaemon Value: C:\WINDOWS\mssreprc.exe&lt;br /&gt;under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run&lt;br /&gt;It changed my C:\WINDOWS\system32\OEMINFO.INI to the following:&lt;br /&gt;&lt;br /&gt;[general]&lt;br /&gt;Manufacturer=SPAC&lt;br /&gt;Model=thespacdude@yahoo.com&lt;br /&gt;[Support Information]&lt;br /&gt;Line1=  ERROR: Water detected in the BIOS.&lt;br /&gt;Line2=&lt;br /&gt;Line3=  Something wonderful has happened,&lt;br /&gt;Line4=  your computer is alive......&lt;br /&gt;&lt;br /&gt;and created a Bart Simpson Logo as a bmp file&lt;br /&gt;C:\WINDOWS\system32\Oemlogo.bmp&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-111046068984518834?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/111046068984518834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=111046068984518834' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/111046068984518834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/111046068984518834'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/03/spacdaemon-virus.html' title='SpAcDaemon Virus'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110934973327449394</id><published>2005-02-26T00:26:00.000+08:00</published><updated>2005-02-26T00:42:13.276+08:00</updated><title type='text'>Import mails from Thunderbird to Microsoft Outlook step by step</title><content type='html'>&lt;p style="font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt;1. Download a program called &lt;a href="http://www.broobles.com/imapsize/"&gt;IMAPSize&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;2. After installing IMAPSize, run it. You dont have to create an account, just click "no".&lt;br /&gt;&lt;br /&gt;3. Click on "tools" -&amp;gt; mbox2eml&lt;br /&gt;&lt;br /&gt;4. Locate C:\Documents and Settings\USERNAME\Application Data\Thunderbird\Profiles\xtsb8for.default\Mail\Local Folders\Inbox file, "Inbox" is the mbox file that Thunderbird stores all your inbox mails.&lt;br /&gt;&lt;br /&gt;5. Create a folder such as C:\eml and save the eml files there&lt;br /&gt;&lt;br /&gt;6. Click on convert, this will convert each of your mail in your Thunderbird mailbox into an eml file.&lt;br /&gt;&lt;br /&gt;7. Now you can open Outlook Express.&lt;br /&gt;&lt;br /&gt;8. Go to C:\eml, select all eml files, drag and drop them to the Inbox or whatever mail folder you wish in Outlook Express&lt;br /&gt;&lt;br /&gt;9. Open Outlook, click on File - Import/export, then import from Outlook Express&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110934973327449394?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110934973327449394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110934973327449394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110934973327449394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110934973327449394'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/02/import-mails-from-thunderbird-to.html' title='Import mails from Thunderbird to Microsoft Outlook step by step'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110507171756973043</id><published>2005-01-07T13:20:00.000+08:00</published><updated>2005-01-07T15:56:14.876+08:00</updated><title type='text'>How do I add install/uninstall option to a C# windows service program?</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;1. Add this to your service project&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;/*****************************&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;&lt;br /&gt;* install.cs&lt;br /&gt;&lt;br /&gt;* Install the service&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;&lt;br /&gt;*/ &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;using System;&lt;br /&gt;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;&lt;br /&gt;using System.Configuration.Install;&lt;br /&gt;&lt;br /&gt;using System.ServiceProcess;&lt;br /&gt;&lt;br /&gt;namespace MyService&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;[RunInstaller(true)]&lt;br /&gt;&lt;br /&gt;public class MyInstaller : Installer&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public MyInstaller()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;ServiceProcessInstaller spi=new ServiceProcessInstaller();&lt;br /&gt;&lt;br /&gt;spi.Account = System.ServiceProcess.ServiceAccount.LocalSystem;&lt;br /&gt;&lt;br /&gt;spi.Password = null;&lt;br /&gt;&lt;br /&gt;spi.Username = null;&lt;br /&gt;&lt;br /&gt;ServiceInstaller si = new ServiceInstaller();&lt;br /&gt;&lt;br /&gt;si.StartType =ServiceStartMode.Automatic;&lt;br /&gt;si.ServiceName = new MyService().ServiceName;&lt;br /&gt;&lt;br /&gt;this.Installers.Add(spi);&lt;br /&gt;&lt;br /&gt;this.Installers.Add(si);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;2. Add System.Configuration.Install reference to the project&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;3. The main function shuold look like this&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; // The main entry point for the process&lt;br /&gt;&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;string opt=null; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; // install the service if user entered "ServiceMonitor /install"&lt;br /&gt;&lt;br /&gt;if(args.Length &amp;gt;0 )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;opt=args[0];&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(opt!=null &amp;&amp;amp; opt.ToLower()=="/install")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; TransactedInstaller ti= new TransactedInstaller();&lt;br /&gt;&lt;br /&gt;MyInstaller mi = new MyInstaller();&lt;br /&gt;&lt;br /&gt;ti.Installers.Add(mi);&lt;br /&gt;&lt;br /&gt;String path=String.Format("/assemblypath={0}",&lt;br /&gt;&lt;br /&gt;System.Reflection.Assembly.GetExecutingAssembly().Location);&lt;br /&gt;&lt;br /&gt;String[] cmdline={path};&lt;br /&gt;&lt;br /&gt;InstallContext ctx = new InstallContext("",cmdline);&lt;br /&gt;&lt;br /&gt;ti.Context =ctx;&lt;br /&gt;&lt;br /&gt;ti.Install(new Hashtable());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch(System.Exception exp)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Console.WriteLine(exp);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// uninstall the service if user entered "ServiceMonitor /uninstall"&lt;br /&gt;&lt;br /&gt;else if (opt !=null &amp;&amp;amp; opt.ToLower()=="/uninstall")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;TransactedInstaller ti=new TransactedInstaller();&lt;br /&gt;&lt;br /&gt;MyInstaller mi=new MyInstaller();&lt;br /&gt;&lt;br /&gt;ti.Installers.Add(mi);&lt;br /&gt;&lt;br /&gt;String path = String.Format("/assemblypath={0}",&lt;br /&gt;&lt;br /&gt;System.Reflection.Assembly.GetExecutingAssembly().Location);&lt;br /&gt;&lt;br /&gt;String[] cmdline={path};&lt;br /&gt;&lt;br /&gt;InstallContext ctx = new InstallContext("",cmdline);&lt;br /&gt;&lt;br /&gt;ti.Context=ctx;&lt;br /&gt;&lt;br /&gt;ti.Uninstall(null);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch(System.Exception exp)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Console.WriteLine(exp);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;} &lt;/span&gt;    &lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; if(opt==null) // e.g. ,nothing on the command line&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;System.ServiceProcess.ServiceBase[] ServicesToRun;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ServicesToRun = new System.ServiceProcess.ServiceBase[] { new MyService() };&lt;/span&gt;  &lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; System.ServiceProcess.ServiceBase.Run(ServicesToRun);&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; }&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110507171756973043?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110507171756973043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110507171756973043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110507171756973043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110507171756973043'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2005/01/how-do-i-add-installuninstall-option.html' title='How do I add install/uninstall option to a C# windows service program?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110307297236094386</id><published>2004-12-15T09:07:00.000+08:00</published><updated>2004-12-15T09:09:32.360+08:00</updated><title type='text'>BIG5 字元衝突:: BIG5 string conflict </title><content type='html'>Big5中由於設計上的疏失，導致一些屬於控制字元的資料容易引起一些程式環境的誤判。造成顯示出來的中文字不是我們想要的結果。所以我們在寫程式的時候對於中文的處理要特別小心。下面列出了一些容易引發衝碼的文字，寫程式的人，最好都能夠測試下面的字在你的程式中可以正確無誤的被使用。&lt;br /&gt;&lt;p&gt;ASCII(5C) == “\”&lt;/p&gt;&lt;br /&gt;&lt;p&gt;A45C么 AE5C娉 B85C稞 C25C擺 A55C功&lt;br /&gt;&lt;br /&gt;  AF5C珮 B95C鈾 C35C黠 A65C吒 B05C豹&lt;br /&gt;&lt;br /&gt;  BA5C暝 C45C孀 A75C吭 B15C崤 BB5C蓋&lt;br /&gt;&lt;br /&gt;  C55C髏 A85C沔 B25C淚 BC5C墦 C65C躡&lt;br /&gt;&lt;br /&gt;  A95C坼 B35C許 BD5C穀 AA5C歿 B45C廄&lt;br /&gt;&lt;br /&gt;  BE5C閱 AB5C俞 B55C琵 BF5C璞 AC5C枯&lt;br /&gt;&lt;br /&gt;  B65C跚 C05C餐 AD5C苒 B75C愧 C15C縷&lt;/p&gt;&lt;br /&gt;&lt;p&gt;ASCII(7C) == “|”&lt;/p&gt;&lt;br /&gt;&lt;p&gt;AA7C泜 B47C揉 A87C育 BE7C魯 B27C琍&lt;br /&gt;&lt;br /&gt;  BC7C慝 C67C鸛 A97C尚 B37C逖 BD7C罵&lt;br /&gt;&lt;br /&gt;  A77C坑 B17C悴 BB7C誡 C57C疊 A67C帆&lt;br /&gt;&lt;br /&gt;  B07C院 BA7C漏 C47C辮 AB7C咽 B57C稅&lt;br /&gt;&lt;br /&gt;  BF7C糕 AC7C洱 B67C閏 C07C嚐 AD7C迢&lt;br /&gt;&lt;br /&gt;  B77C會 C17C舉 A47C弋 AE7C徑 B87C腮&lt;br /&gt;&lt;br /&gt;  C27C甕 A57C四 AF7C砝 B97C頌 C37C牘&lt;br /&gt;&lt;br /&gt;  &amp;quot;\&amp;quot;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110307297236094386?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110307297236094386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110307297236094386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110307297236094386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110307297236094386'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/big5-big5-string-conflict.html' title='BIG5 字元衝突:: BIG5 string conflict '/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110264579572089035</id><published>2004-12-10T10:26:00.000+08:00</published><updated>2004-12-10T10:29:55.720+08:00</updated><title type='text'>How to run a piece of JavaScript code after a certain timed delay?</title><content type='html'>&lt;p&gt;This allows you to execute a section of code after a specified amount of time &lt;br /&gt;  has passed.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;  &amp;lt;!--&lt;br&gt;&lt;br /&gt;  setTimeout(&amp;quot;alert('Thirty seconds has passed.');&amp;quot;,30000);&lt;br&gt;&lt;br /&gt;  // --&amp;gt;&lt;br&gt;&lt;br /&gt;  &amp;lt;/script&amp;gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110264579572089035?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110264579572089035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110264579572089035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110264579572089035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110264579572089035'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/how-to-run-piece-of-javascript-code.html' title='How to run a piece of JavaScript code after a certain timed delay?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110264554017785335</id><published>2004-12-10T10:20:00.000+08:00</published><updated>2004-12-10T10:25:40.176+08:00</updated><title type='text'>Allow EZ_Result to display +5Pages link</title><content type='html'>&lt;p&gt;You can download ez_resuls.php from &lt;a href="http://php.justinvincent.com/"&gt;http://php.justinvincent.com/&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Allow EZ_Result to display nav bar like this&lt;br&gt;&lt;br /&gt;  365 Results: [start] 1 2 3 4 5 &lt;font color="#FF0000"&gt;+5Pages&lt;/font&gt; [last]&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For this to work, I added a few lines to the ez_results.php class as follows&lt;/p&gt;&lt;br /&gt;&lt;p&gt; /********************************************************&lt;br&gt;&lt;br /&gt;  * NAVIGATION FORMATTING&lt;br&gt;&lt;br /&gt;  */&lt;br&gt;&lt;br /&gt;  var $show_next_x_page = true;&lt;br&gt;&lt;br /&gt;  var $text_hover_msg_next_x = '+NUMBER Pages';&lt;br&gt;&lt;br /&gt;  var $text_next_x_page = '+NUMBER Pages';&lt;br&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In function build_navigation(), I added the following.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; $current_page = ($_REQUEST['BRSR'] / $this-&amp;gt;num_results_per_page) +1;&lt;br&gt;&lt;br /&gt;  $page_left = $this-&amp;gt;num_pages-$current_page ;&lt;br&gt;&lt;br /&gt;  &lt;br&gt;&lt;br /&gt;  if($this-&amp;gt;show_next_x_page)&lt;br&gt;&lt;br /&gt;  if ( ($this-&amp;gt;num_pages &amp;gt;= $this-&amp;gt;num_browse_links) &amp;amp;&amp;amp; (($_REQUEST['BRSR'] &lt;br /&gt;  + $this-&amp;gt;num_results_per_page) &amp;lt; $this-&amp;gt;num_results))&lt;br&gt;&lt;br /&gt;  {&lt;br&gt;&lt;br /&gt;  if(($page_left * $this-&amp;gt;num_results_per_page &amp;gt;= $this-&amp;gt;num_results &lt;br /&gt;  ) || ($current_page * $this-&amp;gt;num_results_per_page) &amp;lt; $this-&amp;gt;num_results &lt;br /&gt;  )&lt;br&gt;&lt;br /&gt;  {&lt;br&gt;&lt;br /&gt;  if($page_left &amp;gt;= $this-&amp;gt;next_x_pages){&lt;br&gt;&lt;br /&gt;  $cur_a = $_REQUEST['BRSR'] + $this-&amp;gt;num_results_per_page * $this-&amp;gt;next_x_pages;&lt;br&gt;&lt;br /&gt;  $out .= $this-&amp;gt;create_link(preg_replace(&amp;quot;/\?.*/&amp;quot;,'',$_SERVER['PHP_SELF']) &lt;br /&gt;  . '?BRSR='. ($cur_a) .$this-&amp;gt;qs,$this-&amp;gt;merge_num('next_x_page',$this-&amp;gt;next_x_pages),$this-&amp;gt;merge_num('hover_msg_next_x',$this-&amp;gt;next_x_pages),$this-&amp;gt;get_style('next')).' &lt;br /&gt;  ';&lt;br&gt;&lt;br /&gt;  }&lt;br&gt;&lt;br /&gt;  else{&lt;br&gt;&lt;br /&gt;  $cur_a = $_REQUEST['BRSR'] + $this-&amp;gt;num_results_per_page * $page_left;&lt;br&gt;&lt;br /&gt;  $out .= $this-&amp;gt;create_link(preg_replace(&amp;quot;/\?.*/&amp;quot;,'',$_SERVER['PHP_SELF']) &lt;br /&gt;  . '?BRSR='. ($cur_a) .$this-&amp;gt;qs,$this-&amp;gt;merge_num('next_x_page',$page_left),$this-&amp;gt;merge_num('hover_msg_next_x',$page_left),$this-&amp;gt;get_style('next')).' &lt;br /&gt;  '; &lt;br&gt;&lt;br /&gt;  }&lt;br&gt;&lt;br /&gt;  }&lt;br&gt;&lt;br /&gt;  &lt;br&gt;&lt;br /&gt;  }&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110264554017785335?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110264554017785335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110264554017785335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110264554017785335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110264554017785335'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/allow-ezresult-to-display-5pages-link.html' title='Allow EZ_Result to display +5Pages link'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110258299785270689</id><published>2004-12-09T17:00:00.000+08:00</published><updated>2004-12-09T21:50:19.623+08:00</updated><title type='text'>How do I identify unknown open ports and their associated applications.?</title><content type='html'>&lt;p&gt;You can go to &lt;a href="http://www.foundstone.com" title="http://www.foundstone.com"&gt;http://www.foundstone.com&lt;/a&gt; &lt;br /&gt;  and download Fport. It will show you something like this&lt;/p&gt;&lt;br /&gt;&lt;p&gt;FPort v2.0 - TCP/IP Process to Port Mapper&lt;br&gt;&lt;br /&gt;  Copyright 2000 by Foundstone, Inc.&lt;br&gt;&lt;br /&gt;  http://www.foundstone.com&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Pid Process Port Proto Path&lt;br&gt;&lt;br /&gt;  1764 inetinfo -&amp;gt; 25 TCP C:\WINDOWS\System32\inetsrv\inetinfo.exe&lt;br&gt;&lt;br /&gt;  1764 inetinfo -&amp;gt; 80 TCP C:\WINDOWS\System32\inetsrv\inetinfo.exe&lt;br&gt;&lt;br /&gt;  1620 Apache -&amp;gt; 81 TCP C:\Apache\Apache2\bin\Apache.exe&lt;br&gt;&lt;br /&gt;  988 -&amp;gt; 135 TCP&lt;br&gt;&lt;br /&gt;  4 System -&amp;gt; 139 TCP&lt;br&gt;&lt;br /&gt;  1764 inetinfo -&amp;gt; 443 TCP C:\WINDOWS\System32\inetsrv\inetinfo.exe&lt;br&gt;&lt;br /&gt;  4 System -&amp;gt; 445 TCP&lt;br&gt;&lt;br /&gt;  1764 inetinfo -&amp;gt; 1038 TCP C:\WINDOWS\System32\inetsrv\inetinfo.exe&lt;br&gt;&lt;br /&gt;  2536 mqsvc -&amp;gt; 1047 TCP C:\WINDOWS\System32\mqsvc.exe&lt;br&gt;&lt;br /&gt;  5632 msnmsgr -&amp;gt; 1056 TCP C:\Program Files\MSN Messenger\msnmsgr.exe&lt;br&gt;&lt;br /&gt;  5632 msnmsgr -&amp;gt; 1057 TCP C:\Program Files\MSN Messenger\msnmsgr.exe&lt;br&gt;&lt;br /&gt;  5632 msnmsgr -&amp;gt; 1058 TCP C:\Program Files\MSN Messenger\msnmsgr.exe&lt;br&gt;&lt;br /&gt;  5632 msnmsgr -&amp;gt; 1059 TCP C:\Program Files\MSN Messenger\msnmsgr.exe&lt;br&gt;&lt;br /&gt;  5632 msnmsgr -&amp;gt; 1060 TCP C:\Program Files\MSN Messenger\msnmsgr.exe&lt;br&gt;&lt;br /&gt;  3076 -&amp;gt; 1062 TCP&lt;br&gt;&lt;br /&gt;  1736 FlashComAdmin -&amp;gt; 1111 TCP C:\Program Files\Macromedia\Flash Communica&lt;br&gt;&lt;br /&gt;  tion Server MX\FlashComAdmin.exe&lt;br&gt;&lt;br /&gt;  3796 OSDK62http -&amp;gt; 1422 TCP C:\Program Files\Openwave\SDK 6.2.2\program&lt;br&gt;&lt;br /&gt;  \http\OSDK62http.exe&lt;br&gt;&lt;br /&gt;  5480 firefox -&amp;gt; 1668 TCP C:\Program Files\Mozilla Firefox\firefox.ex&lt;br&gt;&lt;br /&gt;  e&lt;br&gt;&lt;br /&gt;  5480 firefox -&amp;gt; 1669 TCP C:\Program Files\Mozilla Firefox\firefox.ex&lt;br&gt;&lt;br /&gt;  e&lt;br&gt;&lt;br /&gt;  2536 mqsvc -&amp;gt; 1801 TCP C:\WINDOWS\System32\mqsvc.exe&lt;br&gt;&lt;br /&gt;  2492 FlashCom -&amp;gt; 1935 TCP C:\Program Files\Macromedia\Flash Communica&lt;br&gt;&lt;br /&gt;  tion Server MX\FlashCom.exe&lt;br&gt;&lt;br /&gt;  2184 omtsreco -&amp;gt; 2030 TCP c:\oracle\ora92\bin\omtsreco.exe&lt;br&gt;&lt;br /&gt;  2536 mqsvc -&amp;gt; 2103 TCP C:\WINDOWS\System32\mqsvc.exe&lt;br&gt;&lt;br /&gt;  2536 mqsvc -&amp;gt; 2105 TCP C:\WINDOWS\System32\mqsvc.exe&lt;br&gt;&lt;br /&gt;  2536 mqsvc -&amp;gt; 2107 TCP C:\WINDOWS\System32\mqsvc.exe&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110258299785270689?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110258299785270689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110258299785270689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110258299785270689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110258299785270689'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/how-do-i-identify-unknown-open-ports.html' title='How do I identify unknown open ports and their associated applications.?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110257097695748015</id><published>2004-12-09T13:41:00.000+08:00</published><updated>2004-12-09T13:42:56.956+08:00</updated><title type='text'>How to open a file as a string from a URL in PHP?</title><content type='html'>&lt;span style="font-family:arial;"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;// This will read the text file from http://yoursite.com/test.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;// and store the contents of test.txt into $contents&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;$handle = fopen("http://yoursite.com/test.txt", "rb");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;$contents = '';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;while (!feof($handle)) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;  $contents .= fread($handle, 8192);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fclose($handle);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110257097695748015?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110257097695748015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110257097695748015' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110257097695748015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110257097695748015'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/how-to-open-file-as-string-from-url-in.html' title='How to open a file as a string from a URL in PHP?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110239965838613299</id><published>2004-12-07T14:02:00.001+08:00</published><updated>2004-12-09T13:44:51.280+08:00</updated><title type='text'>WML 怎麼顯示中文?</title><content type='html'>因為 WML 只接受 UNICODE, 如果你沒有經過 convert, 你就會看到亂碼&lt;br /&gt;&lt;br /&gt;下面 mb_convert_encoding($str, "UTF-8", "BIG-5"); 就可以把字串 convert&lt;br /&gt;成 Unicode 啦&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;// send wml headers&lt;br /&gt;&lt;br /&gt;header("Content-type: text/vnd.wap.wml");&lt;br /&gt;&lt;br /&gt;echo "&amp;lt;?xml version=\"1.0\"?&amp;gt;";&lt;br /&gt;&lt;br /&gt;echo "&amp;lt;!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""&lt;br /&gt;&lt;br /&gt;. " \"http://www.wapforum.org/DTD/wml_1.1.xml\"&amp;gt;";&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;wml&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;card&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$str = "哈囉";&lt;br /&gt;&lt;br /&gt;$str = mb_convert_encoding($str, "UTF-8", "BIG-5");&lt;br /&gt;&lt;br /&gt;print "&amp;lt;br/&amp;gt;Hello World! $str";&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/card&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/wml&amp;gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110239965838613299?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110239965838613299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110239965838613299' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110239965838613299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110239965838613299'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/wml_06.html' title='WML 怎麼顯示中文?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110238592033950375</id><published>2004-12-07T10:14:00.000+08:00</published><updated>2004-12-07T10:18:40.340+08:00</updated><title type='text'>How to create a Hello World WML script using PHP?</title><content type='html'>&lt;span style="font-family: arial;font-size:85%;" &gt;&lt;?php&lt;br /&gt;// send wml headers&lt;br /&gt;header("Content-type: text/vnd.wap.wml");&lt;br /&gt;echo "&lt;?xml version=\"1.0\"?&gt;";&lt;br /&gt;echo "&lt;!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""&lt;br /&gt;. " \"http://www.wapforum.org/DTD/wml_1.1.xml\"&gt;";&lt;br /&gt;?&gt;&lt;br /&gt;&lt;wml&gt;&lt;br /&gt;&lt;card&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;print "&lt;br/&gt;Hello World!";&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/card&gt;&lt;br /&gt;&lt;/wml&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110238592033950375?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110238592033950375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110238592033950375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110238592033950375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110238592033950375'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/12/how-to-create-hello-world-wml-script.html' title='How to create a Hello World WML script using PHP?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110153675436930802</id><published>2004-11-27T14:14:00.000+08:00</published><updated>2004-11-27T14:26:39.186+08:00</updated><title type='text'>How do I schedule the server to generate static HTML files from other dynamic web pages?</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;Some people would use Perl or PHP to grab data from the database and generate the HTML when the scripts are executed. I'm just too lazy to write another script for a dynamic web page which is already written in languages such as PHP, Perl, ASP, JSP, ColdFusion, etc. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;What I do is create a shell script file and utilize OS' pipe function and a text browser to create the HTML file. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;For example:  create a text file called generate.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;lynx -source http://someURL.com/yourCode.asp  &gt;  yourStaticASP.html&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;lynx -source http://someURL.com/yourCode.php?Var=123  &gt;  yourStaticPHP.html&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial;"&gt;and do a chmod on the file, make sure it is executable, e.g.,  chmod u+x generate.sh&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial;"&gt;You may then schedule this script file in your cron table ;-)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110153675436930802?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110153675436930802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110153675436930802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110153675436930802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110153675436930802'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/11/how-do-i-schedule-server-to-generate.html' title='How do I schedule the server to generate static HTML files from other dynamic web pages?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110149080408801886</id><published>2004-11-27T01:38:00.000+08:00</published><updated>2004-11-27T01:40:04.086+08:00</updated><title type='text'>How do I use a hyperlink to POST form variable? </title><content type='html'>How do I use a hyperlink to POST form variable? &lt;br /&gt;&lt;p&gt;&amp;lt;form name="aform" action="somewhere.php" method="post"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;input type="hidden" name="firstName" value=" &amp;lt;?php echo $firstName ; ?&amp;gt; "&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;input type="hidden" name="lastName" value=" &amp;lt;?php echo $lastName ; ?&amp;gt; "&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;input type="hidden" name="section" value="0"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; Simply add a little JavaScript somewhere in the &amp;lt;head&amp;gt; ... &amp;lt;/head&amp;gt; part of your page and we're done. The JavaScript would look something like this... &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;function clickpost(param) &lt;br /&gt;&lt;br /&gt;{ &lt;br /&gt;&lt;br /&gt;document.forms.aform.elements .section.value = param; &lt;br /&gt;&lt;br /&gt;document.forms.aform.submit; &lt;br /&gt;&lt;br /&gt;return true; &lt;br /&gt;&lt;br /&gt;} &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110149080408801886?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110149080408801886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110149080408801886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110149080408801886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110149080408801886'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/11/how-do-i-use-hyperlink-to-post-form.html' title='How do I use a hyperlink to POST form variable? '/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110149042096578568</id><published>2004-11-27T01:29:00.000+08:00</published><updated>2004-11-27T01:33:40.966+08:00</updated><title type='text'>Javascript download script</title><content type='html'>&amp;lt;script language="JavaScript" type="text/javascript"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;!-- &lt;br /&gt;&lt;br /&gt;function beginDownload() { &lt;br /&gt;&lt;br /&gt;idl = -1; &lt;br /&gt;&lt;br /&gt;idl = location.search.indexOf("idl=n"); &lt;br /&gt;&lt;br /&gt;if (idl &amp;lt; 0) document.write('&amp;lt;iframe height="0" width="0" &lt;br /&gt;&lt;br /&gt;src="PUT_URL_FOR_DOWNLOAD_FILE_HERE"&amp;gt;&amp;lt;/iframe&amp;gt;'); &lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;window.onLoad=beginDownload(); &lt;br /&gt;&lt;br /&gt;//--&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt; &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110149042096578568?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110149042096578568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110149042096578568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110149042096578568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110149042096578568'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/11/javascript-download-script_26.html' title='Javascript download script'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110148997122335121</id><published>2004-11-27T01:25:00.000+08:00</published><updated>2004-11-27T01:26:11.223+08:00</updated><title type='text'>Some useful regular expressions... </title><content type='html'>&lt;span style="font-family: arial;"&gt;e-mail (?:(?:\b([_a-z0-9-]+(?:\.[_a&lt;/span&gt; &lt;div style="font-family: arial;" id="mb_0"&gt;&lt;wbr&gt;-z0-9-]+)*)@([_a-z0-9-]+(?:\.[&lt;wbr&gt;_a-z0-9-]+)*)\.(?:[a-z]{2,3})&lt;wbr&gt;\b))&lt;br /&gt;&lt;br /&gt;HTML tag (?:(?:&lt;[^&gt;]+&gt;))&lt;br /&gt;HTML start (?:(?:&lt;[^//][^&gt;]*&gt;))&lt;br /&gt;[HTMLEndTag] (?:(?:&lt;/[^&gt;]+&gt;))&lt;br /&gt;&lt;br /&gt;[QuotedString] (?:(?:[\"](?:(?:[\\][\"])|[^\"&lt;wbr&gt;]){1,}[\"]))&lt;br /&gt;IP addr&lt;br /&gt;(?:(?:\b([01]?\d\d?|2[0-4]\d&lt;wbr&gt;|25[0-5])\.([01]?\d\d?|2[0-4]&lt;wbr&gt;\d|25[0-5])\.([01]?\d\d?|2[0-4&lt;wbr&gt;]\d|25[0-5])\.([01]?\d\d?|2[0&lt;wbr&gt;-4]\d|25[0-5])\b))&lt;br /&gt;&lt;br /&gt;Credit Card (?:(?:(\d{3,4})[- ]?(\d{4})[- ]?(\d{4})[- ]?(\d{4})))&lt;br /&gt;HyperLink&lt;br /&gt;(?:(?:(ftp|http|https|telnet&lt;wbr&gt;|gopher|nntp)://([_a-z\d\-]+(?&lt;wbr&gt;:\.[_a-z\d\-]+)+)((?:[_a-z\d\-&lt;wbr&gt;\\\./]+[_a-z\d\-\\/])+)*))&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110148997122335121?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110148997122335121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110148997122335121' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110148997122335121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110148997122335121'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/11/some-useful-regular-expressions.html' title='Some useful regular expressions... '/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9335777.post-110148928305366637</id><published>2004-11-27T00:43:00.000+08:00</published><updated>2004-11-27T01:23:32.336+08:00</updated><title type='text'>How Do I get row number with SQL commands in MySQL?</title><content type='html'>&lt;p style="font-family: arial;" class="style1"&gt;Let's suppose we have a table look like this&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="font-family: arial;" class="style1"&gt;&lt;br /&gt;Name           PhoneNumber&lt;br /&gt;--------------    --------------------&lt;br /&gt;Peter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;415-895-5689&lt;br /&gt;John&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 408-854-4587&lt;br /&gt;Louis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;408-975-5986&lt;br /&gt;&lt;/p&gt; &lt;br /&gt; &lt;span style="font-family:arial;"&gt;And now I want to issue a SQL command which gives back a row number for each record which would look like this&lt;/span&gt;&lt;br /&gt;&lt;p style="font-family: arial;" class="style1"&gt;&lt;br /&gt;RowNumber   Name                   PhoneNumber&lt;br /&gt;-----------------    --------------------    ---------------------&lt;br /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;Peter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;415-895-5689&lt;br /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;John&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 408-854-4587&lt;br /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;Louis&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;408-975-5986&lt;br /&gt;&lt;/p&gt; &lt;br /&gt;&lt;span style="font-family:arial;"&gt;Under Oracle, this would be simple task, just issue the following SQL command&lt;/span&gt;&lt;br /&gt;&lt;blockquote style="font-family: arial;" class="style1"&gt;SELECT rownum, Name, PhoneNumber from table;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-family:arial;"&gt;However, MySQL does not offer such convinience as rownum. In MySQL, we need to do the following instead.&lt;/span&gt;&lt;br /&gt;&lt;p style="font-family: arial;" class="style1"&gt; mysql&gt; SET @rownum := 0; &lt;/p&gt;&lt;span style="font-family:arial;"&gt;mysql&gt; SELECT @rownum := @rownum + 1 AS RowNumber, Name, PhoneNumber from table;&lt;/span&gt;&lt;br /&gt;&lt;p style="font-family: arial;" class="style1"&gt;Hope this tip can help you solve your current problem :) &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9335777-110148928305366637?l=eddietech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://eddietech.blogspot.com/feeds/110148928305366637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9335777&amp;postID=110148928305366637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110148928305366637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9335777/posts/default/110148928305366637'/><link rel='alternate' type='text/html' href='http://eddietech.blogspot.com/2004/11/how-do-i-get-row-number-with-sql.html' title='How Do I get row number with SQL commands in MySQL?'/><author><name>Eddie Chen</name><uri>http://www.blogger.com/profile/13554915914020355766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='28' src='http://4.bp.blogspot.com/_G5CEE9fBDhc/SfpK7WruekI/AAAAAAAAH_Q/RdlzrDxB82M/S220/n549199198_288.jpg'/></author><thr:total>0</thr:total></entry></feed>
