Feed on
Subscription

For AJAX application order form builds a mistake to refer a system



    summary when process of a few application breaks down,They often offer an opportunity to submit the information about this mistake to the user.This information can help developer track and correct an error.If why apply the implementation in the program in your JavaScript/AJAX,the article will be revealed to you such function.

    one, foreword

If     can access the word of the computer of terminal user,So the JavaScript mistake of terminal user is debugged very easily.Since you cannot realize such operation,So you can be adopted leave such measure:The content that lets an user send you to amend this problem to need to you.

    when like Mozilla browser such applied process breaks down,They can start a mistake to submit an order.Whether are these programs willing inquiry user to submit erroneous report.If the user is willing,When this program will ask they input the process that concerns them to break down as far as possible much information.This information,Along with this are wrong the analytic data that submits him order,So that develop personnel and project manager to read,refer email center together take an analysis.

    this kind of function to developer it is extremely useful.Since this program moves at the client to carry a machine,go up,This is to be obtained exclusively about cannot be at developer on the development system of themselves the way that makes same wrong news afresh.They still can monitor so that this specific wrong frequency and seriousness decide to should correct what error above all.

If why support this kind of mistake to refer a function in JavaScript/AJAX program,    article general is revealed to you.When a mistake happens in the code in you,This system will play the window that gives an user to be able to refer wrong message.

    two, problem

If why     installs an user mistake to submit an order in the JavaScript/AJAX application process in me?

    three, solve

    puts code in a program that pack,The email that should pack a program to allow an user to refer to contain detailed and erroneous information.

    (one) capture mistake

    following file is included in the download source code with corresponding article,You can use them to achieve the solution above:

This file includes Talkback.js- of     · the complete source of this system

Test.html- of     · uses Talkback.js to handle the script of give typical examples with a wrong discovery

The Test.html page here includes code of a few JavaScript,Cast among them give unusual.This page is function Fun_a() installation the Onload processor of Body part.This Fun_a() function calls Fun_b() again,Fun_b() calls Fun_c() again.Finally,Fun_c() accesses the nonexistent region in a nonexistent object,Spark a true JavaScript is unusual.

    above all,Before the user can see this mistake you need to capture it.Such since,You can make the user has an opportunity to refer wrong message;But,You do not think those who let he or her to see any other content.Our target is the content that reduces this mistake to be exposed to the user as far as possible.

    this is very easy implementation.Assume the main program is OK by is following function activations:
Function Fun()
{
  / / program here.
}Fun = Tb_wrap(Fun);

    is opposite here please of Tb_wrap() call.Such since,Can put Fun() function to be able to capture any unusual and those who handle them pack implement in.And,Such since,What this user won't see any in Fun() happening is unusual.

    (two) gather erroneous information

    once you captured mistake,So you need to extract as far as possible much information.You send a developer more erroneous data hair,They discover more likely and correct this error.

What     regrets is,The browser that moves according to the user is different,Wrong object has different property.Below most circumstance,You can depend on Name and Message attribute.Notice,An extremely useful inn trace is contained in Stack attribute,It is it can be used in the is based on Mozilla browser of the closest version only only.

...

The characteristic of.NET string,criterion how is expression amid applied




  不管创建什么类型的应用程序,你都需要使用字符串。无论数据如何存储,终端用户总要与可读的文本打交道。因此,了解如何使用字符串是任何.NET开发者创建丰富的应用程序所需要学习的必要知识。除了向你展示在.NET框架中字符串的使用外,本文还将向你介绍正规表达式的知识。

  除了向你展示如何使用.NET框架中的字符串外,本文还将向你介绍正规表达式。正规表达式是格式代码,不仅允许你验证一个特定字符串匹配一个给定的格式,而且你还可以使用正规表达式来从任何其它可能被认为是自由格式的文本中提取有意义的信息,例如从用户输入中提取第一个名字,或从一个数字输入中提取代码,或从一个URL中提取服务器名。

  一、 使用字符串

  使用字符串是创建高质量应用程序的一个必要的技巧。即使你在处理数字或图像数据,终端用户也需要上下文反馈。本文将向你介绍.NET字符串,如何格式它们,操作它们和比较它们,及其它有用的操作。

  (一) .NET字符串简介

  在.NET框架和通用语言运行时刻(CLR)以前,开发者总是花费大量时间处理字符串。一个字符串例程可重用库几乎是每一个C和C++程序员的工具箱中的一部分。编写在不同程序语言之间交换字符串数据的代码也是相当困难的。例如,Pascal把字符串存储为一个内存字符数组,其中,该数组的第一个元素指示字符串的长度;而C把字符串存储为一个具有可变长度的字符内存数组,字符串的末端加上一个ASCII null字符(在C中以"\0"表示)。

  在.NET框架中,字符串以常量方式存储。这意味着,当你用C#(或任何其它.NET语言)创建一个字符串时,该字符串以一种固定大小存储在内存以便 CLR运行更快些。结果是,当你实现例如连接字符串或修改一个字符串中的单个字符时,CLR实际上是创建你的字符串的多个副本。

  C#中的字符串与其它值类型例如整数或浮点数声明方式相同,见下面的例子:

...

The HttpCookie of Asp.net writes a Chinese character to read the means of settlement that when taking, piles up for chaos



A student little sister asks me today:The Chinese character is kept in the HttpCookie of Asp.net,Read why is taking a cost random code completely?Actually this is because of what the character codes and cause,The Chinese character is two encode,Just can produce so so random code comes out!The method that solves actually is very simple:When wanting to writing Cookie only,Code its with Url first,Write again next,Read when us when taking again decipher with respect to OK,Hope more student little sisters can solve it,Breathe out ah!

...

The field information that how derives all SQL users are expressed



Use statements of such a Sql please,Try!

SELECT

(Case When A.colorder=1 Then D.name Else '' End) expresses a name,

Serial number of A.colorder field,

Name of A.name field,

(Case When COLUMNPROPERTY(A.id, a.name, 'else '' End) of √ of 'IsIdentity')=1 Then ' marks,

...

Big file uploads research in ASP.NET application



    often should be used to big file to upload in the project,The file that should upload has 100 much M,The comparison that the package discovery that the big document that studies home is used now then uploads uses has two more to accuse an AspnetUpload 2.0 and Lion.Web.UpLoadModule,Two accuse the method is:Use implicit HttpWorkerRequest,The cent in the Pipe that the GetPreloadedEntityBody that uses it and ReadEntityBody method build for ASP.NET from IIS piece read access to occupy.Chris Hynes offerred a such program for us (with HttpModule) ,This plan besides allowing you to upload big file,Still can show in real time upload plan.

    Lion.Web.UpLoadModule and AspnetUpload two.NET component is this program that use.

When     should upload simple document,The method of two software is same,Successive HttpModule


...

Plot of double amortize technology is used below.NET frame



The article basically introduces     the main plot technology of.Net frame.The advantage that will discuss plot technique through brief introduction and program of give typical examples, inferior position and other are relevant note.

   Brief introduction

When     should write the program of system of Windows window of a model fortunately,Window body and accuse the operation such as scale, effect is not to need special those who try to consider.This is why?Through using.Net frame because of,Development staff can procrastinate move a series of accuse to window body,Write a few simple as associated as incident photograph code to press F5 in IDE next,A complete window system program was born!All accusing him him scale,Window body perhaps accuses size and shrink put adjust freely.Use via regular meeting here,And need causes what notice at one o'clock to dominate a result namely.Game,From the definition chart accuses and the writes the compose outside can needing programmer specified number to be used at answering Paint incident code of screen protection program.

The article is aimed at     to body of those Windows window develop personnel and conduce to them using simple plot technology in using to program process.Above all,We can discuss a few basic plot ideas.After all who is in charge of undertaking scale is operated?Program of system of Windows window is to know what when should undertake scale?Those scale code are placed where to be after all?Later,The double buffer technology that still will introduce image scale,You will see what how work it is,How realize cache and the picture that show actually through a method between alternant.Finally,We will be discussed " intelligence is invalid area " ,Weigh draw actually merely namely the invalid part on body of window of process of cleared perhaps application,The indication that accelerates a program and answer speed.The person that hope these concepts and technology can make introduction reads the article,And conduce to mix more quickly program of more effective system of window of development Windows.

Engine of image of use GDI+ of body of     Windows window,All plot code in the article can be involved use mandatory.Net frame to operate and use engine of Windows GDI+ image.

    although the article is used at main window body plot to operate,But it was offerred likewise fast, effective and conduce to the technology that improves program performance and method.So,Before understanding chrestomathy language proposal reader has a basic knowledge to.Net frame,Include episode of body of Windows window Line of processing, simple GDI+ object for example,Pen and Brush.Familiar Visual Basic.Net or C# programming language.

   Concept

Process of     Windows application is him of responsible scale,When body of a window " sordid " ,That is to say window body changed size,Or part by cover of body of other program window,Or from the smallest when changing condition to restore,The information that the program can receive need scale.Windows plants this " sordid " condition is called " invalid (Invalidated) " condition,Our understanding is:Need weighs draw,When program of system of Windows window need weighs draw window it is met when body the information that gets scale from inside Windows message alignment.Go in the PaintBackground that course.Net frame encloses this information to deliver window form next and Paint incident,Proper in afore-mentioned incident book writes the code that is used technically at scale can.

The plot give typical examples with   simple   is as follows:

...

Different Web accuses a photograph intermodulation between to use in Asp.net 2.0



In Asp.net 2.0,Should accuse in different Web between call each other,Must want %26lt;%@ Reference VirtualPath=%26quot; another control a name %26quot; %26gt; will cite,Citing is as follows

Default.aspx:
%26lt;form Id=%26quot;form1%26quot; Runat=%26quot;server%26quot;%26gt;
%26lt;uc1:WEbUserControl Id=%26quot;WebUserControl1%26quot; Runat=%26quot;server%26quot;%26gt;
%26lt;/uc1:WEbUserControl%26gt;
%26lt;uc2:WEbUserControl2 ID=%26quot;WebUserControl2_1%26quot; Runat=%26quot;server%26quot; /%26gt;
%26lt;/form%26gt;

...

How to make full use of ASP.NET 2.0 is compiled beforehand




When personnel often hears an user to complain to call applied program first, the development of     ASP.NET 1.x can encounter initialization delay.After all,The first time the request can initiate process of a series,Include to run library initialization, analysis, compile ASPX page into intermediate language, compile the method into this locality code to wait a moment immediately.

...

Use C# implementation to tag window of type message clew




    needs as a result of the project for some time nearly dedicated all the time at the process designing of UI respect,For more friendly present clew information the user,We must hint to Windows message of the standard the window undertakes handling.All of us uses U below Windows XP dish, shine put wait for mobile storage equipment,Should insert go up or unplug area of column of the task when leaving these facility can show a flaxen setting,And have the clew window that tags a style to play come out,Such clew friendlies namely beautiful,So this is after all how come true?The truth is not actually complex,Should tagging itself of type clew window is body of an irregular window,The arrowhead that when show its meeting will tag the window is pointed to different accuse.Pursue as follows:

...

The consideration of function of ASP.NET 2.0 page



Usually we are in     normally in a page,Incident of knot hinge face handles a model,By order step by step statement handles a process individually.The synchronism that this says namely is handled (Synchronous) ,We are OK the very convenient order that defines page processing.Although synchronous processing is very convenient,But can reveal serious problem when time-consuming tall request is handled,In tall concurrent on website production server,Because.net processing is,be based on so called ThreadPool,And the processing line Cheng in Threadpool is finite,If the line Cheng in current ThreadPool is already all spent,After that if afterwards has ceaseless large-scale request again,The function of the server with respect to can serious fall,More serious still can make the server breaks down.The it how come namely is better to how come namely use.net ThreadPool with our so most care.The function of the play that makes.net better.

This must talk about     respecting the asynchronous of.net is handled (Asynchronous) , the model is BeginXXX commonly, endXXX, beginXXX returns an IAsycResult object,The information that includes pair of current asynchronous operations among them,And EndXXX user accepts return of value,Output parameter..net allocates Cheng of a free line to return ThreadPool instantly next to BeginXXX from inside ThreadPool, when when asynchronous handles an end,.net allocates Cheng of a free line to be used at handling EndXXX method from inside ThreadPool again.The thing that so possibly enough line Cheng is used at handling other.See at length the asynchronous that we talk about Asp.net 2.0 only here handles a model,We know to be in 1.x when wanting the very good asynchronous that builds a page to handle is more troublesome,Microsoft early realised the likelihood this,The new page that introduces in the version of 2 so handles a model,Joined convenient asynchronous to handle an aspect (Asynchronous Point) between PreRender incident and PreRenderComplete incident,In this asynchronous dot,The page needs to await all asynchronous processing to be finished,Any results that can achieve your need before the page appears so,Great the method that simplified to build asynchronous page.

    joins Async="true" in the @page statement that you want to building a page above all,This is must.The setting tells Asp.net to want to choose IHttpAsyncHandler to handle current page.What next you need to do is in Page_Load incident processing use asynchronous handles a process commonly,There are two kinds of ways now:

    uses Page.AddOnPreRenderCompleteAsync method the first kind to handle the Begin that needs asynchronous processing and End method volume namely. As follows:


...
« 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »