Feed on
Subscription

ASP.NET generates RSS Feed



Before     paragraph time is writing RSS Feed.

The modification that     passed a few times,Write relevant code into alone kind.What go to the lavatory quite still calculate when feeling put sb in a very important position.Stick then come out,Everybody studies together.It is RssBase.cs below kind:

...

C# makes aleatoric irregular button



   C# makes aleatoric irregular button! (The principle pursues according to setting scale Button)


Using System.Drawing.Drawing2D;Private Void Button3_Paint(object Sender, system.Windows.Forms.PaintEventArgs E)
{This.button3.Cursor = Cursors.Hand;
Bitmap BmpBob =(Bitmap)this.button3.Image;
GraphicsPath GraphicsPath = CalculateControlGraphicsPath(bmpBob);This.button3.Region = New Region(graphicsPath);
}Private Static GraphicsPath CalculateControlGraphicsPath(Bitmap Bitmap)
{

GraphicsPath GraphicsPath = New GraphicsPath();

Color ColorTransparent = Bitmap.GetPixel(0, 0);
Int ColOpaquePixel = 0;
For(int Row = 0; Row%26lt;Bitmap.Height; Row ++ )
{ ColOpaquePixel = 0;
For(int Col = 0; Col%26lt;Bitmap.Width; Col ++ )
{
If(bitmap.GetPixel(col, row) ! = ColorTransparent)
{
ColOpaquePixel = Col;
Int ColNext = Col;
For(colNext=colOpaquePixel; ColNext%26lt;bitmap.Width; ColNext++ )If(bitmap.GetPixel(colNext, row)==ColorTransparent)Break;
GraphicsPath.AddRectangle(new Rectangle(colOpaquePixel, Row, colNext - ColOpaquePixel, 1));
Col = ColNext;
}
}
} Return GraphicsPath;
}

...

ASP.NET page incident



    is inside the life cycle of ASP.NET page,The standard event that the object meets Page be used often a few more publicly.When frame of ASP.NET page is moving,Can automatic join arrives (even the line) the corresponding representative example of these methods.Such you need not be written necessary " stick accept code " .The following list is pressed arouse order to provide the acting example that the line connects when moving:

...

In ASP.NET code the visit dogs information



    ASP.NET 2.0 allows to pass code to come to those who visit every request dog in TraceFinished incident information.TraceFinished incident is by TraceContext the object is caused,Use at dogging publicly after gathering all request information message.Can use this incident the output that to dogging information undertakes differring.The following code uses program output to dog namely information.

    C# :


...

ASP.NET skill:Judge sexual distinction and birthday according to Id



%26lt;%@ Page Language=%26quot;c#%26quot; Codebehind=%26quot;CordBirthday.aspx.cs%26quot; AutoEventWireup=%26quot;false%26quot; Inherits=%26quot;CodeDatum.birthday.CordBirthday%26quot; %%26gt;
%26lt; ! DOCTYPE HTML PUBLIC %26quot;-//W3C//DTD HTML 4.0 Transitional//EN%26quot; %26gt;
%26lt;HTML%26gt;
%26lt;HEAD%26gt;
%26lt;title%26gt;CordBirthday%26lt;/title%26gt;
%26lt;meta Name=%26quot;GENERATOR%26quot; Content=%26quot;Microsoft Visual Studio.NET 7.1%26quot;%26gt;
%26lt;meta Name=%26quot;CODE_LANGUAGE%26quot; Content=%26quot;C#%26quot;%26gt;
%26lt;meta Name=%26quot;vs_defaultClientScript%26quot; Content=%26quot;JavaScript%26quot;%26gt;
%26lt;meta Name=%26quot;vs_targetSchema%26quot; Content=%26quot;http://schemas.microsoft.com/intellisense/ie5%26quot;%26gt;
%26lt;script Language=%26quot;javascript%26quot;%26gt;Function ShowBirthday(val)
{Var BirthdayValue;If(15==Val.length)
{//15 Id numberBirthdayValue = Val.charAt(6)+val.charAt(7);If(parseInt(birthdayValue)%26lt;10)
{BirthdayValue = '20'+birthdayValue;
}Else
{BirthdayValue = '19'+birthdayValue;
}BirthdayValue=birthdayValue+'-'+val.charAt(8)+val.charAt(9)+'-'+val.charAt(10)+val.charAt(11);If(parseInt(val.charAt(14)/2)*2! =val.charAt(14) )Document.all.sex.value=' male ';ElseDocument.all.sex.value=' female ';Document.all.birthday.value=birthdayValue;
}If(18==Val.length)
{//18 Id numberBirthdayValue=val.charAt(6)+val.charAt(7)+val.charAt(8)+val.charAt(9)+'-'+val.charAt(10)+val.charAt(11)

...

The implementation of the multiligualism in the Windows process designing of C#



The method of multiligualism of     implementation is through configuring a file to come true,Take resource through be being read from inside configuring a file,When showing the window next,Namely in Load() method,Trends shows corresponding choice language.

The measure that multiligualism of the implementation in the Windows process designing in C# is below     :

    the first pace:Install acquiescent language and modification acquiesce language

We defined     file of a XML will deposit acquiescent language,File name is LanguageDefine.xml.

    LanguageDefine.xml


...

Use criterion code of Html of expression take out




using System.Text.RegularExpressions;//需要引用

// 利用正则表达式去掉"%26lt;"和"%26gt;"之间的内容
private string StripHT(string strHtml)
{
Regex regex=new Regex("%26lt;.+?%26gt;",RegexOptions.IgnoreCase);
string strOutput=regex.Replace(strHtml,"");
return strOutput;
}

...

ASP.NET generates high quality skeletonize to pursue general function (C# code)



When the website is developed, generating skeletonize to pursue is a blame often sees with practical function. It is previously in Asp can component of Com of have the aid of comes true, kind of powerful library of frame can be used to come true easily in.net now. Below post give whole code (take detailed annotate) , the picture that consulted a few articles on the net reach home of network of.QQROOM of.net Sdk relevant content uploads used formula of all 4 kinds of unripe set prescription.
/ / / %26lt;summary%26gt;
/ / / generate skeletonize to pursue
/ / / %26lt;/summary%26gt;
/ / / method of graph of %26lt;param Name=%26quot;originalImagePath%26quot;%26gt; source (physical method) %26lt;/param%26gt;
/ / / method of graph of %26lt;param Name=%26quot;thumbnailPath%26quot;%26gt; skeletonize (physical method) %26lt;/param%26gt;
/ / / %26lt;/param%26gt; of width of graph of %26lt;param Name=%26quot;width%26quot;%26gt; skeletonize
/ / / %26lt;/param%26gt; of height of graph of %26lt;param Name=%26quot;height%26quot;%26gt; skeletonize
/ / / the means %26lt;/param%26gt; that %26lt;param Name=%26quot;mode%26quot;%26gt; generates skeletonize to pursue Public Static Void MakeThumbnail(string OriginalImagePath, string ThumbnailPath, int Width, int Height, string Mode)
{
Image OriginalImage = Image.FromFile(originalImagePath);
Int Towidth = Width;Int Toheight = Height;
Int X = 0;Int Y = 0;Int Ow = OriginalImage.Width;Int Oh = OriginalImage.Height;

...

ASP.NET:Write a program that steals countrywide public transportation database



Others often is heard to do previously collect an order,I am small also today try skill..Using System;Using System.Collections;Using System.ComponentModel;Using System.Data;Using System.Drawing;Using System.Web;Using System.Web.SessionState;Using System.Web.UI;Using System.Net;Using System.Text;Using System.Text.RegularExpressions;Using System.IO;Using System.Data.SqlClient;Using System.Web.UI.WebControls;Using System.Web.UI.HtmlControls;

...

Changeover of image of the implementation in ASP.NET2.0 filters the effect




  本文描述一种创建定制Web控件的容易方法,并把该控件使用于一个ASP.NET 2.0 web页面中显示微软DirectX图像转换过滤效果。

  一、简介

  本文描述一种创建定制web控件并应用于一个ASP.NET 2.0 web页面中显示微软DirectX图像转换过滤效果的容易的方法。文中包括一个拥有11个不同控件的类库,每一个控件分别展示微软DirectX图像转换过滤效果的某些方面。在这11个控件中,5个是页面过渡效果控件,其它的6个是用于增强文本外观的过滤效果控件。

  在这6个用于增强文本外观的过滤效果控件中,每一个被实现为一个容器控件。这将允许用户或者直接把文本键入到该容器,或把一个标签放到该控件中并且把相应效果应用到这个标签上。选择使用一个标签控件的目的是为了提供一种容易的基于标准HTML的方法来实现调整大小、居中放置以及格式化文本。

  剩下的5个控件用于在一个web页面中添加页面过渡效果而不用编写任何额外的HTML或VB代码。为了使用这些控件,用户仅需要把它们拖动到表单上。然而,这些控件没有相应的可视化组件,尽管页面能够被显示到浏览器中;当用户离开页面时,相应的过渡效果用于打开下一个页面。

  相应于本文的示例工程中包含了一个简单的网站,含有单个default.aspx页面;该页面逐个展示上面的6个文本增强控件和一个页面过渡效果控件。

  注意 本文中应用于演示工程和控件库的方法仅适用于Internet explorer,并没有针对其它浏览器类型提供支持。如果你在一家企业内网中工作并且你能够确保所有的用户都能够存取Internet explorer,那么这个控件集和这里的方法可能对你很有用。如果你公开地发布这些控件,那么,使用一个非Internet explorer浏览器冲浪的用户仍然能够读取相应的文本但是该效果将不存在。如果你确实想进行公开发布,那么你可以首先检查用户的浏览器并且如果它不是 IE的话,你应该建议他们最好使用IE来观看该站点。

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