Someone is WRONG on the Internet

Add Comment | Aug 19, 2008

Windows: Logon failure: the user has not been granted the requested logon type at this computer

Add Comment | Aug 16, 2008

When you share a Folder from a Windows XP machine, you might not able to access to it even you see that computer in it's work group, any time you attempt to access to, you receive a error message like

  • \\[SHARE] is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have  access permissions. 
  • Logon failure: the user has not been granted the requested logon type at this computer

 

When ran into it, you can consider one of two solution I found from others over Internet. It  might help a lot.

Audit Local Security Settings

  1. On Start Menu>Control Panel>Users, enable Guest user.
  2. Open Local Security Settings by select Start Menu>Control Panel>Administrative Tools>Local Security Settings
  3. Navigate to Local Policies>User Rights Assignment
  4. Right-click on Access this computer from the network>Properties>Add Users or Groups, add everyone or any users you want to be able to access the computer from the network > Add Guest user to this if not exists
  5. Right-click on Deny access to this computer from the network>Properties, remove everyone or any users you do NOT want denied to be able to access the computer from the network > Remove Guest user from this if exists

Using Windows Server 2003 Resource Kit Tools (Steve Winograd)

 

  1. Download and install the Windows 2003 Server Resource Kit Tools
    from http://go.microsoft.com/fwlink/?LinkId=4544 .
  2. Click Start | All Programs | Windows Resource Kit Tools | Command Shell.
  3. Type these lines at the command prompt. The second and third commands are case-sensitive, so type them exactly as shown. Note the "+r" in the second one and the "-r" in the third one:
    • net user guest /active:yes
    • ntrights +r SeNetworkLogonRight -u Guest
    • ntrights -r SeDenyNetworkLogonRight -u Guest

 

Technorati Tags: ,

Windows: Remote Desktop Shutdown/Restart/Hibernate

Add Comment | Aug 16, 2008

You'll not see "Shutdown" in Start Menu anymore when you are connected to a workstation via Remote Desktop, the "Shutdown" option changes to "Disconnect". If you want to turn off the computer, hibernate it, or put it on stand-by, there are really more than one solution to get thing done

  1. Open Task Manager, from the main Menu and select your shutdown option under "Shutdown" menu.
  2. On the desktop and type Alt+F4. This will call up the shutdown dialog.
  3. And the last way I know is using shutdown utilities from Star->Run command, here are some samples
    • "shutdown" to shutdown
    • "shutdown -r" to reboot
    • "shutdown -i" to get a GUI
    • "shutdown -l" to logoff

Off course that all need administrative privileges on the remote computer, you might supply your administrator account by %windir%\system32\runas.exe /user:AdminAcctNameHere "%windir%\system32\shutdown.exe -s "

 

ASP.NET: Can't not logged in successful on a few computer

Add Comment | Jul 30, 2008

One of our ASP.NET web application goes to production for months. Last week, we received reports on a few computers , users can't log-in with their correct credentials. We asked them to have administrator control on a computer which problem happen. After make sure that their Browser security, Anti-spyware, Anti-Virus and anything might cause the problem. We have decided install a HTTP traffic monitor tool like IE Web Developer V2 to see what happening on this computer with our website

  1. The browser requests the specified login.aspx page
  2. The server responds with the login page
  3. The user fills in the login page and submits the form, so the browser POST the form back to the login page
  4. If the credentials are valid, the server responds with another "302 Page Moved" status, a Location header pointing to a protected.aspx, and a Set-Cookie header providing the encrypted Forms Authentication Ticket. Everything seem as it happen on working computer.
  5. Get redirected to login.aspx page again

Nothing potential caused the problems and we did frustrated after 5 days without able to location is that wrong in client side or server side after

  • Replace authentication module by new one
  • Setup brand new application to a sandbox
  • Review Web server configurations
  • And anything we can think to....

Really headache, huh ?

God bless us, when we almost ran out of time and received more bad report from our users, we found why. I'm glad to share you our report on this problems, due to rights have been removed

 

Introduction

- When user provide correct username/password, Concorde will send them a authentication cookie with Issued date and Expired Date, these date are in GMT time zone.

- In our application, the authentication cookies will be expired in next 30’, as described in timeout attribute of <Forms…> tag of Web.config.

- This cookies is very important in order to authenticate visitor in HTTP stateless environment

Problems

- User can’t login occasionally in few computers, reported seem to be Internet Explorer 6 problems, FireFox and IE 7 are seem to be fine.

- We have re-write code to replace authentication by another alternative methods, but not work.

- Tracing Raw HTTP with some HTTP traffic monitoring tools show that

o Login code work well

o Authentication cookie issued but Internet Explorer seem rejected it without a reason (surely Its not blocked by security policy), cookies appeared and lost ==> YES, this is problem.

- We have check to make sure nothing straight  happen to

o Browser, Browser’s security and privacy setting

o Client’s antivirus, firewall, anti-spyware,…

o Evaluating setting of websites, domains, sub-domains, and whole IIS setting, still see nothing.

o Online community doesn’t help at all.

Root cause

- Hopelessly, but how about cookie’s expired time ?

- Follow that idea and found there are something wrong to Cookie expired date, We didn’t really that because the value are in GMT, when client machine are in GMT-7. Convert current time in Server Machine, Client Machine to GMT, It’s clearly that Expired Date of the cookie are in past, and of course that IE will rejected it because it was expired.

- That mean there are something wrong with clocks on Server or Client machine here, but if this bug is occasionally happen, then this client’s clock must be the one wrong, I check out and see that this machine doesn’t auto-syn with Internet time server, that’s is.

- Also noticed that might be this is Daylight-saving problem and found a useful paper at http://support.microsoft.com/kb/934413

Solution

- Change timeout value of authentication cookie from 30 minutes to 120 minutes by change timeout="120" <forms name="XYZAuthentication" protection="All" path="/" loginUrl="~/Login.aspx" slidingExpiration="true" timeout="120" cookieless="UseCookies"/> in Web.config.

- Noticed that will not sure when clock on client machine faster than server machine above 2 hours (120 minutes), then ask end-users to

o Automatically synchronize with an Internet time server as attached screenshot

o Follow Microsoft’s Daylight Saving Time Help at http://support.microsoft.com/dst2007

 

.NET Framework 3.5 Training Kit

Add Comment | Jul 30, 2008

- The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management.

- The .NET Framework 3.5 Enhancements Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the .NET 3.5 Enhancement features including: ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX History, ASP.NET Silverlight controls, ADO.NET Data Services and ADO.NET Entity Framework.

  1. Visual Studio 2008 and .NET Framework 3.5 Training Kit
  2. .NET 3.5 Enhancements Training Kit

 

ASP.NET: Read Authentication Form Timeout value

Add Comment | Jul 18, 2008

When you write a custom Membership provider, you might need to know timeout value of authentication form which declared in Web.config tto fullfil to your custom authentication ticket

// Get form authentication time-out

ASP.NET: Display Row Index number in GridView, DataGrid, Repeater, DataList

Add Comment | Jul 05, 2008

Solution #1

<asp:TemplateField>
    <ItemTemplate>
        <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
</asp:TemplateField>

Solution #2

  • Template
<asp:TemplateField>
    <ItemTemplate>
        <asp:Label runat="server" ID="lblRowIndex"/>   
    </ItemTemplate>
</asp:TemplateField>
  • Behind code

protected void GridView1_RowCreated1(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow) { 
        Label lblRowIndex= (Label)e.Row.Cells(0).Controls(0); 
        lblRowIndex.Text = (e.Row.RowIndex + 1).ToString();
    }
}

AJAXToolKit: ModalPopupExtender and Form validation issues

Add Comment | Jul 05, 2008

Why Validation Controls Don't Work ?

Found on http://www.myonlyblog.com/2007/07/modalpopup-validation-controls-dont.html:

"The solution, it turned out is REAL simple, don't use either the OkControlID or OnOkScript. Basically you don't need the OkControlID or OnOkScript to be set unless you plan on doing some processing on the client side, this was why I was not firing the validation controls, I was posting back first because I had both of these set."

Keep the ModalPopupExtender open when something wrong in Server processing

For example, you lets user to enter a data entry form in a ModalPopupExtender (something like Matt Berseth 's work at  http://mattberseth.com/blog/2008/04/masterdetail_with_the_gridview.html), and you want to notify user if something wrong and data couldn't be saved properly and keep the ModalPopupExtender open, just all ModalPopupExtender.Show() in catch block of your try...catch statement.

Anyway, if you like http://mattberseth.com/blog/2008/04/masterdetail_with_the_gridview.html, you must read his bug fix http://mattberseth.com/blog/2008/05/bug_bashbuttoncausesvalidation.html too !

 

ASP.NET: Create ASP.NET 2.0 Multilingual Websites

Add Comment | May 12, 2008
  1. Localizing process (from Michèle Leroux Bustamante)
    • Design pages by applying a combination of static HTML and ASP.NET server controls.
    • Prepare static areas for localization by wrapping them with the ASP.NET Localize control.
    • Provide proper control names to all server controls so that generated event handlers and resource keys can be easily recognized.
    • Create shared resources in the App_GlobalResources subdirectory. These can be .resx files that already exist, or new .resx files created to hold terms that will be shared across several pages.
    • Associate shared resources with control properties using explicit resource expressions, where appropriate. It is best to do this before generating local resources for the page.
    • Generate local resources while in Page Design view by selecting the Generate Local Resource menu item.
  2. Video How Do I: Create a Multi-Lingual Site with Localization? from ASP.NET 2.0 "How Do I" video series of Scott Stansfield
  3. Tutorials
  4. Advanced
  5. To be continuing...

SQL Server CE: Unable to check if a table exist before drop

Add Comment | May 04, 2008

IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'YOUR_TABLE')
DROP TABLE ''YOUR_TABLE'

will NOT work because SQL CE are not support that IF EXISTS statement in this case, how awful ?

WP Theme &Icons by N.Design Studio adapted by timheuer
RSSATOM Login