Upload
giuice
View
98
Download
0
Embed Size (px)
Citation preview
TEN.PSA
:
TEN.PSA
gnimmargorP
[email protected] : PSA.TEN
2
:
[email protected] : PSA.TEN
3
:
.
www.psanari.ten
.
:
:
[email protected] moc.allaw@yrihsab_M
moc.oohay@yrihsab_damahoM
:
ptth//:yrihsaB.gignaisrep.moc/koobE 4831/3/71
[email protected] : PSA.TEN
4
9....................................................................................................................................TEN.PSA
01.......................................................................................................................................TEN.tfosorciM
31.................................................................................................................................................................. TEN.PSA
71................................................................................................................................................ TEN.PSA
91.....................................................................................................................................TEN.PSA
22...............................................................................................................TEN.PSA
52.....................................................................................................................................................
03.........................................................................................................................................................................
33......................................................................................................................................TEN.
53.................................................................................................................................................................................RLC
14............................................................................................................................revres tneilC
94.................................................................................................................................TEN.PSA
25.........................................................................................................................
16...................................................................................................... TEN.PSA
37.................................................................................................................................................TEN.PSA gnihsaC
87...........................................................................................................TEN.PSA
28..............................................................................................................................................TEN.PSA
48.....................................................................................................................................................TEN.PSA
88...................................................................................................................................... noitagivaN tramS
19......................................................................................................................................................TEN.PSA
[email protected] : PSA.TEN
5
49....................................................................................................................................................... dnihebedoC
89....................................................................................................................................................... ecapsemaN
601..............................................................................................................TEN.PSA daolpU
111.................................................................................................................................................TEN.PSA gnihsaC
711.....................................................................................................................................
121........................................................................................................................ TEN.PSA
721..................................................................................................................TEN.PSA
441.............................................................................................................................1.1 krowemarF TEN.
841..........................................................................3002 TEN. oidutS lausiV 01
151...............................................................................................................................................TEN.PSA daerhT
361............................................................................................................................................TEN.PSA
071............................................................................................................................TEN.PSA LMX
371.............................................................................................................................................. LMX
671...........................................................................................................................................................TEN.PSA
081...............................................................................................................TEN.PSA
381............................................( )3002 4
791...................................................................................................................................yebdihW TEN.PSA
202................................................................................................................................TEN.PSA etatS noisseS
602......................................................................................................................................TEN.PSA
902................................................................................................................TEN.PSA
412................................................................................................................................ gifnoc.beW
[email protected] : PSA.TEN
6
122.....................................................................( )TEN.PSA liaMrI
822.....................................................................( )TEN.PSA liaMrI
532.........................................................TEN.PSA
842................................................................................................................................................TEN.PSA
852......................................................................( )TEN.PSA LMX
462......................................................................( )TEN.PSA LMX
672................ tropeR latsyrC TEN. puteS
872..................................................................................................................................................................TEN.
082.........................................noitacitnehtuAsmroFelpicnirP cireneG
582................................................................................................................................TEN.PSA
203........................................................................................................................ SSR
113................................................................................. 0.2 TEN.PSA x.1 TEN.PSA
823................................................................................ 0.2 TEN.PSA x.1 TEN.PSA
743.........................................................................................................................................TEN.PSA
453........................................................................................................................ TEN.PSA
463....................................................................................................................... TEN.PSA
373.............................................................................................................................................................
973....................................................................................................TEN.PSA )soihW(
583.....................................................................................................................
393.........................................................................................................................................TEN.PSA
004..........................................................................................................................................................TEN.PSA
[email protected] : PSA.TEN
7
404..................................................................................................................................................
504.......................................................................................................................................................................LMTH
804...............................................................................................................................................TEN.PSA
214..............................................................................................................TEN.PSA
714........................................................................................................................................................ lebaL
024..................................................................................................................tsiLyarrA xoBtsiL
224................................................................................................................................................. knilrepyH
424..................................................................................................................................................................
924.......................................................................................................TEN.PSA
234....................................................................................................................................................
534...........................................................................................................................................
244..............................................................................................................................................................
644.............................................................................................................................................dirGataD
054............................................................................................................................................rotatoRdA
354.............................................................................................................................TEN.PSA
754...................................................................................................( ) etatSweiV
954..................................................................................................( ) etatSweiV
464...........................................................................................................xoBtsiL
174..............................................................................................................TEN.PSA xoBtsiL
974...........................................................................................................................................TEN.PSA tpircSavaJ
884.................................................................................................................................................tsiLataD
[email protected] : PSA.TEN
8
094...........................................................................................TEN.PSA
794..............................................................................................................................................dirGataD
105.........................................................................................................................dirGataD
805...................................................................................... teSataD
415.................................................................................................................................................... -
915................................................................................................................................................... -
625.........................................egaP retsaM : 0.2 TEN.PSA
535................ egaP retsaM : 0.2 TEN.PSA
045...................................................................................... lortnoCresU
445.................................................................................................................................................................................
[email protected] : PSA.TEN
9
TEN.PSA
[email protected] : PSA.TEN
01
1TEN.tfosorciM
TEN.
. TEN. TEN
: TEN. TEN. . TEN.
.
TEN.
. 0043 TEN.
.
. LMX
TEN.
TEN.
. ecapseman
. OI.metsyS
OI.metsyS eliF .
TEN.PSA . eliF.OI.metsyS
LMTH . beW.metsyS .
ten.psanari 1
[email protected] : PSA.TEN
11
slortnoCbeW.IU.beW.metsyS beW slortnoCLMTH.IU.beW.metsyS
.
TEN.
. )seilbmessA( TEN.
.
OI.metsyS .
lld.bilrocsM . lld.bilrocsM
. TEN.
.
.
TEN.
TEN. ehT( TEN.
TEN.PSA . )RLC - emitnuR egaugnaL nommoC
.
)egaugnaL etaidemretnI tfosorciM(
[email protected] : PSA.TEN
21
. LISM . LI LISM
TEN.PSA .
TIJ LISM . LISM
LISM TEN.PSA .
.
.
#C TEN.PSA
. ++C
. LISM
TEN.
#C .
.
[email protected] : PSA.TEN
31
1 TEN.PSA
PSA TEN.PSA
. PSA segaP revreS evitcA
.
TEN.PSA
.
. TEN.PSA .
. TEN.PSA
TEN.PSA
.
. TEN.PSA
. TEN.PSA
. TEN.PSA
. dirGataD
. TEN. TEN.PSA
ten.psanari 1
[email protected] : PSA.TEN
41
. TEN.PSA 0054 TEN.
.
.
PSA TEN.PSA
. PSA PSA TEN.PSA
tpircSJ tpircSBV PSA .
-( #C cisaB lausiV TEN.PSA
noitacilppA ,esnopseR ,tseuqeR( PSA . (
0054 TEN.PSA )revreS ,noisseS
PSA TEN.PSA . TEN.
TEN.PSA .
. PSA LMTH
TEN.PSA
. TEN. TEN.PSA
. TEN.tpircSJ #C TEN.cisaB lausiV
++C TEN.PSA
. TEN.PSA
. TEN.PSA
. TEN.PSA LOBOC LREP
[email protected] : PSA.TEN
51
TEN.PSA
TEN.PSA . xoBtsiL xoBtxeT
: TEN.PSA .
.nottuB xoBtsiL nottuBoidaR xoBtxeT
.
.
.
TEN.oidutS lausiV
dapetoN .
.
TEN.PSA
TEN. TEN.PSA TEN.PSA
.
krowemarF TEN.
NET.ASP : [email protected]
16
[email protected][email protected]/downloads/com.microsoft.msdn
xml.fmsdncompositedoc2_976f2_000f2_027f2_files-msdn
ASP.NET )Windows 2000 Server (Professional Windows
XP .
[email protected] : PSA.TEN
71
1 TEN.PSA
TEN.PSA
. : TEN.PSA
.
. LMTH
. TEN.PSA
.
>"revreS"=tanuR tpircStpircS/lmthdaeh/eltit/eltitdaehydobydob/lmth/"revreS"=tanuR tpircS< 1
daoL-egaP . >/tpircS<
lebaL txeT .
.
.
lebaL . LMTH
. LMTH TEN.PSA
: lebaL
>/"revreS"=tanuR "lebaLym"=DI lebaL:psa"revreS"=tanuR tpircS% "liaM.beW.metsyS"=ecapSemaN tropmi@ %tcejbO<
ni-gulP .
.
.
. EI
telppA avaJ
. mroftalP
>telppA< . .
.
. )MVJ(
.>telppA< >tcejbO< :
daoLnwoD
. )MVJ(
[email protected] : PSA.TEN
86
. daolnwoD
uneM nwoD-porD .
.
lmtH
lmtH
.
:ediS-revreS
lmtH -1
.
-2
.
. -3
. lmtH -4
. -5
. lmtH -6
[email protected] : PSA.TEN
96
: ediS-tneilC .
. lmtH
. TEN.PSA PSA .
.
.
ecafretnI yawetaG nommoC IGC
. IGC .
PSA
) IGC .
lreP C . lreP(
. ++C
. mroftalP
egaP revreS evitcA PSA
[email protected] : PSA.TEN
07
PSA TEN.PSA
.
PSA . tpircSBV
.)lld.PSA(
.
.
. TEN.PSA
egaP revreS avaJ PSJ
PSA . lmX lmtH
)SII(
PSA PSJ .
2avaJ PSJ .
. seirarbiL 2avaJ snaeBavaJ
noisuFdloC
.
.
.
SII . noisuFdloC
[email protected] : PSA.TEN
17
ekiL-lmtH .
(. TEN.PSA )
!
PHP
txetrepyH PHP egaP emoH lanosreP
. rossecorperP
TN mroftalP-ssorC TEN.PSA
. lreP C .
.
TEN.PSA
TEN.PSA
.)lld.ipasItenpsa( TEN.PSA .
) TEN.PSA .
: (
ediS revreS TEN.PSA
.
[email protected] : PSA.TEN
27
tpircSBV PSA
(. TEN.PSA . )tpircSBV
TEN.tpircsJ #C TEN.BV .
. TEN.PSA nohtyP lreP
[email protected] : PSA.TEN
37
1TEN.PSA gnihcaC
TEN.PSA gnihcaC
PSA - gnihcaC 1
PSA gnihcaC
.
PSA gnihcaC
) )tneilC(
(. LMTH
PSA
gnihcaC
. gnihcaC
PSA . gnihcaC
gnihcaC TEN.PSA .
. TEN.PSA PSA
TEN.PSA gnihcaC -2
: . PSA TEN.PSA
>% "..." = maraPyByraV "..." = noitaruD ehcaCtuptuO @%<
1
[email protected] : PSA.TEN
47
)>% ... @%% "enon" = maraPyByraV "51" = noitaruD ehcaCtuptuO @%% "eman" = maraPyByraV "021" = noitaruD ehcaCtuptuO @%% "enon" = maraPyByraV "03" = noitaruD ehcaCtuptuO @%% "liaM.beW.metsyS"=ecapsemaN tropmI @%% @%< : evitcerid egaP( noitagivaN tramS
evitceriD egaP . gifnoc.bew
:
>% eurt=noitagivaNtramS egaP @%noitarugifnoCbew.metsyS/ eurt=noitagivaNtramS segaPbew.metsyS/noitarugifnoC/"revres"=ranur tpircS< TEN.SV
. dnihebedoc
1
[email protected] : PSA.TEN
59
dnihebedoc
XPSA TEN.PSA . tcejbo TEN.PSA
. egaP.IU.beW.metsyS
TEN.PSA ( )
. ehcac
XPSA
.
. egaP.IU.beW.metsyS
dnihebedoc
egaP.IU.beW.metsyS XPSA
:
>% "egaPweN.ecapsemaNruoY"=stirehnI egaP @%% "egaPweN.ecapsemaNruoY"=stirehnI "sc.xpsa.egaPweN"=crS egaP @%% "slortnoCbeW.IU.beW.metsyS" = ecapseman tropmI @%% "slortnoCbeW.IU.beW.metsyS" = ecapseman tropmI @%% "slortnoCLMTH.IU.beW.metsyS" = ecapseman tropmI @%% "eman ecapseman" = ecapseman tropmI @%LMTHDAEHELTIT/ELTIT"revres"=tanur "bv"=egaugnal tpircStpircs/DAEH/YDOB"atad-mrof/trapitlum"=epyTcne "tsop"=dohtem MROF<
>"revres"=tanur "eliFtupnIyM"=eman "elif"=epyt "eliFtupnIyM"=di tupni<
>"timbuS"=eulav "timbus"=epyt tupni<
>MROF/<
>YDOB/LMTH/"revres"=tanur "eliFtupnIyM"=eman "elif"=epyt "eliFtupnIyM"=di tupniydob"atad-mrof/trapitlum"=epyTcne "tsop"=dohtem mrof
[email protected] : PSA.TEN
801
>"revres"=tanur "eliFtupnIyM"=eman "elif"=epyt "eliFtupnIyM"=di TUPNI"timbuS"=eulav "timbus"=epyt tupnimrof/ydob/"revres"=tanur "bv"=egaugnal tpircsbew.metsys< gifnoc.enihcam gifnoc.bew
>/"0000001"=htgneLtseuqeRxam emitnuRptth? "8-ftu"=gnidocne "0.1"=noisrev lmx? noitarugifnocbew.metsys<
>/ "0000001"=htgneLtseuqeRxam emitnuRptth<
>bew.metsys/<
>noitarugifnoc/
[email protected] : PSA.TEN
111
TEN.PSA1 gnihcaC
tnemgarF TEN.PSA gnihcaC
. gnihcaC ataD gnihcaC tuptuO egaP gnihcaC
TEN.PSA gnihcaC -1
: gnihcaC
.
. gnihcaC:
.sresworb tneilc revres yxorp ,revres beW gnihcaC
: gnihcaC
gnihcac tuptuO
gnihcac tnemgarF
gnihcac ataD
-gnihcaC tuptuO 2
gnihcaC tuptuO
ten.psanari 1
[email protected] : PSA.TEN
211
gnihcaC tuptuO
. ehcac
. ehcac
gnihcaC tuptuO
. UPC
gnihcaC tuptuO
.
.xcsa xpsa. .xmsa gnihcaC tuptuO
.
ehcaCtuptuO@
: gnihcaC tuptuO
>% "enon"=mraPyByraV "ynA"=noitacoL "006"=noitaruD ehcaCtuptuO @%% "tnuoc;noitacol"=maraPyByraV "01"=noitaruD ehcaCtuptuO @%% "egaugnaL-tpeccA"=redaeHyByraV "06"=noitaruD ehcaCtuptuO @%% "#C"=egaugnaL @%revres=tanur tpircs
[email protected] : PSA.TEN
511
{ etatS gnirtS cilbup
} ;eulaV.etats nruter { teg
} } ;etatS = eulaV.etats { tes
{ yrtnuoC gnirtS cilbup
} ;eulaV.yrtnuoc nruter { teg
} } ;yrtnuoC = eulaV.yrtnuoc { tes
>tpircs/ x And x >= 0 Then
result = CType(temp(x), triple)
End If
Return result
End Function
End Class
Public Structure triple
Public name As String
Public ID As Integer
Public data As String
End Structure
Global.asax :
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
StaticContainer.InitThing()
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Session.Add("key", DateTime.Now.Ticks.ToString("x"))
StaticContainer.AddContainer(Session.Item("key"))
NET.ASP : [email protected]
120
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
StaticContainer.RemoveContainer(Session.Item("key"))
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application ends
StaticContainer.KillThing()
End Sub
ID Container Session .
Hashtable Session
. :
StaticContainer.AddToContainer(TextBox1.Text, Integer.Parse(TextBox2.Text),
TextBox3.Text, Session.Item("key"))
Dim t As triple = StaticContainer.GetEntry(Integer.Parse(TextBox4.Text),
Session.Item("key"))
ListBox1.Items.Add(t.name)
ListBox1.Items.Add(t.ID.ToString())
ListBox1.Items.Add(t.data)
triple .
: 600=tutorialid?aspx.tutorials/com.dotnetjunkies.www://http
[email protected] : PSA.TEN
121
1 TEN.PSA
SYSODC. TEN.PSA
TEN.PSAnarI
liam-E
. TEN.PSA
. TEN.PSA
:
]#C[
;)(egasseMliaM wen = MMjbo egasseMliaM
;"moc.tsohym@em" = morF.MMjbo
;"moc.tsohruoy@uoy" = oT.MMjbo
;"!emocleW" = tcejbuS.MMjbo
;"TEN.PSAnarI ot emocleW" = ydoB.MMjbo
;)MMjbo(dneS.liaMptmS
.
: noitpecxE
.dilavni si eulav noitarugifnoc "gnisUdneS" ehT
1
[email protected] : PSA.TEN
221
.
revreS egnahcxE tfosorciM 3 kcaP ecivreS :
. . tsoh !
.
. SII revreS PTMS
.
.
STNODC. SYSODC .
egnahcxE XEODC . TN 0002
.
SYSODC
: . STNODC
. : revreS PTMS
. 52 :
. noitacitnehtuA PTMS drowssap emanresu
NET.ASP : [email protected]
123
: .
.
: .
IranASP.NET !
.
IranASP.NET
:
[C#]
int cdoSendUsingPickup = 1;
string cdoSendUsingMethod = "http://schemas.microsoft.com/
cdo/configuration/sendusing";
string cdoSMTPServerPickUpDirecory = "http://schemas.microsoft.com/
cdo/configuration/smtpserverpickupdirectory";
// You can uncomment each line when you need it!
//string cdoSMTPServer = "http://schemas.microsoft.com/
cdo/configuration/smtpserver";
//string cdoSMTPServerPort = "http://schemas.microsoft.com/
cdo/configuration/smtpserverport";
//string cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/
cdo/configuration/smtpconnectiontimeout";
//string cdoSMTPAuthenticate = "http://schemas.microsoft.com/
NET.ASP : [email protected]
124
cdo/configuration/smtpauthenticate";
//string cdoSendUserName = "http://schemas.microsoft.com/
cdo/configuration/sendusername";
//string cdoSendPassword = "http://schemas.microsoft.com/
cdo/configuration/sendpassword";
//For CDOSYS, the pickup directory is located at
c:\inetpub\mailroot\pickup
string strPickup = "c:\\inetpub\\mailroot\\pickup";
CDO.Message objMM = new CDO.Message ();
ADODB.Fields Flds = objMM.Configuration.Fields;
Flds[ cdoSendUsingMethod ].Value = cdoSendUsingPickup;
Flds[ cdoSMTPServerPickUpDirecory ].Value = strPickup;
Flds.Update ();
objMM.HTMLBodyPart.Charset = "utf-8";
objMM.MimeFormatted = true;
objMM.From = "[email protected]";
objMM.To = "[email protected]";
objMM.Subject = "Welcome!";
objMM.HTMLBody = "Welcome to
IranASP.NET!";
NET.ASP : [email protected]
125
objMM.Send ();
utf-8 HTMLBody .
DLL bin GAC
) bin :(
adodb.dll
Interop.CDO.dll
2000 .
References Visual Studio .NET .
:
1. CDO for Windows 2000
msdn.microsoft.com/library/default.asp@url=_2flibrary_2fen-
us_2fcdosys_2fhtml_2f_cdosys_about_cdo_for_windows_2000.asp
2. CDO for Win2000: Messaging Configuration
msdn.microsoft.com/library/default.asp@url=_2flibrary_2fen-
us_2fcdosys_2fhtml_2f_cdosys_messaging_configuration.asp
3. CDO for Win2000: Configuring the Message Object
NET.ASP : [email protected]
126
msdn.microsoft.com/library/default.asp@url=_2flibrary_2fen-
us_2fcdosys_2fhtml_2f_cdosys_configuring_the_message_object.asp
4. CDO for Win2000: Creating and Sending a Message
msdn.microsoft.com/library/default.asp@url=_2flibrary_2fen-
us_2fcdosys_2fhtml_2f_cdosys_messaging_examples_creating_and_sending_a_mes
sage.asp
5. PRB: Microsoft Exchange 2000 Server Service Pack 3 Security
Modification and CDOEX/CDOSYS
support.microsoft.com/@kbid=324037
6. Sending Email Via an External SMTP Server Using CDO
www.asp101.com/articles/john/cdosmtprelay/default.asp
[email protected] : PSA.TEN
721
TEN.PSA1
. )etalpmet(
( ... )
.
. .
.
.
( traP niaM )
( ) .
)traP niaM(
.
.
smrofsnottubdirgatad ) traP niaM
(....
1
[email protected] : PSA.TEN
821
.
.
.
)emarF(
LMTH
LMTH .
. tpircSavaJ )MOD(
.
niaM( .
. )traP
.
rab sserddA
gnitagivan hserfer
!
TEN.PSA
. slortnoc resU
.
[email protected] : PSA.TEN
921
.
dniheb edoc .
.
lortnoC resU
resu
. lortnoc
: .
)1(
)traP niaM( )3( )2(
. traP niaM 3
2 1 3
( CU lortnoC resU )
: ) 1 . )lenaP( .
(xcsa.ogol_lenaP
---elif xcsa.ogol_lenaP---
NET.ASP : [email protected]
130
panel_logo .
.
: UC runat=server .
.
HTML .
.
:
---Panel_right.ascx file---
Home Page
Searching
About Us
NET.ASP : [email protected]
131
.
runat=server Codebehind
.
. property
. Codebehind :
---Panel_right.ascx.vb file---
Protected WithEvents td1 As System.Web.UI.HtmlControls.HtmlTableCell
Protected WithEvents td2 As System.Web.UI.HtmlControls.HtmlTableCell
Protected WithEvents td3 As System.Web.UI.HtmlControls.HtmlTableCell
td1,td2,td3 . property :
Public WriteOnly Property current_page() As Integer
Set(ByVal Value as Integer)
Select Case Value
Case 1
td1.InnerHtml = "Home Page"
Case 2
td2.InnerHtml = "Searching"
Case 3
td3.InnerHtml = "About Us"
NET.ASP : [email protected]
132
End Select
End Set
End Property
current_page 2 searching
searching
.
.
template.aspx :
---template.aspx---
My site
NET.ASP : [email protected]
133
] [ (Main
Part)
)
directive page ( .
) : aboutus.aspx)(
---aboutus.aspx---
My site
[email protected] : PSA.TEN
431
>rt"2"=napsloc dtogol_lenap:etisym/"revres"=tanur "1ogol_lenap"=di ogol_lenap:etisymdt/rt/dtdt/dtdt/rtrt/elbat/ydob/LMTH/"0"=redrob "2"=ecapsv "075"=htdiw "fig.vda/segami"=crs "47"=thgieh GMI% "xcsa.ogol_lenaP"=crS "ogol_lenaP"=emaNgaT "etisyM"=xiferPgaT retsigeR @%%"etalpmet.etis"=stirehnI
>LMTHdaeh/< etis yM >daehydobelbatrt"2"=napsloc dt<
NET.ASP : [email protected]
138
:
[Codes that are for main part of the page, must put here.]
HTML :
.
: (segment_top.ascx)
---segment_top.ascx---
NET.ASP : [email protected]
139
Codebehind="segment_top.ascx.vb" Inherits="site.segment_top" TargetSchema=
"http://schemas.microsoft.com/intellisense/ie5" %>
My site
HTML directive .
code behind .
(segment_down.ascx):
---segment_down.ascx---
[email protected] : PSA.TEN
041
>dt/<
>rtrt/elbat/ydob/LMTH/pot_tnemges:etisym /"revres"=tanur "1pot_tnemgeS"=di pot_tnemges:etisym vda_lenap:etiym/"revres"=tanur "1vda_lenap"=di vda_lenap:etisym%@ %< .
.( )
1
[email protected] : PSA.TEN
461
tropmI egaP krowemarF
xpsa egaP .
. ...
: / BV TEN.PSA
>% "lmx/txet"=epyTtnetnoC "BV"=egaugnaL egaP @%% "eurT"=gubeD "eurT"=ecarT egaP @%% "eulav"=ecapseman tropmI @%"emanhtap"=crS "egaugnaledoc"=egaugnal "revres"=tanur tpircstpircs/lmth"revres"=tanur "BV"=egaugnal tpircstpircs/ydob"revres"=tanur mrof
[email protected] : PSA.TEN
661
>/revres=tanur "emaN"=di xobtxet:psa< :eman ruoy retnE
>/"revres"=tanur "kcilC_ntBretnE"=kcilcnO "retnE"=txet nottub:psa<
>p<
>/revres=tanur "egasseM"=di lebal:psa<
>mrof/ydob/lmth/revres"=tanur mrof"<
. TEN.PSA
-4
TEN.PSA LMTH
. : .
. >% %< .
>%= %< .
: .
NET.ASP : [email protected]
167
dim strMessage as string
sub page_load
strMessage="Hello!"
end sub
The Value Of strMessage is
The Value Of strMessage is
.
5-
. ASP.NET .
[email protected] : PSA.TEN
861
. TEN.PSA
.
edulcnI -6
. TEN.PSA
:
>-- emanelif = lautriv | elif edulcni# --!-- "xpsa.elifedulcni/ridym/"=lautriv edulcni# --!txet=ssalCssC ltr=rid "%001"=htdiW "revres"=tanur "tsiLataDeht"=di tsiLataD:psaetalpmeTmetI<
>rb% )"etad_swen" ,metIataD.reniatnoC(lavE.redniBataD #%rbrb% )"eltit_swen ,metIataD.reniatnoC(lavE.redniBataD #%< :
>rb% )"ydob_swen" ,metIataD.reniatnoC(lavE.redniBataD #%<
>rh<
>etalpmeTmetI/<
>tsiLataD:psa/rb ", "style=""display:inline"">")
s = s.Replace("
NET.ASP : [email protected]
299
' Replace some HTML entities with true character codes
s = s.Replace("&brkbar;", "|")
s = s.Replace("", "|")
s = s.Replace("", "-")
s = s.Replace("", Chr(160))
s = s.Replace("‚", "'")
s = s.Replace("„", """")
s = s.Replace("", "'")
s = s.Replace("’", "'")
s = s.Replace("", "'")
s = s.Replace("", """")
s = s.Replace("”", """")
s = s.Replace("", """")
s = s.Replace("", "-")
s = s.Replace("&endash;", "-")
JavaScript :
NET.ASP : [email protected]
300
' If we don't do this, JavaScript horks on the site
s = s.Replace("
NET.ASP : [email protected]
301
End Class
: asp.WhitespaceFilter/aspnet/com.codeproject.www://http
NET.ASP : [email protected]
302
RSS 1
RSS . RSS
Really Simple Syndication XML
.
RSS ASP.NET .
RSS
RSS XML .
RSS .
IranASP.NET New Articles RSS Feed
fa-IR
(c) 2004 by IranASP.NET
Sun, 08 Aug 2004 06:11:37 GMT
Sun, 08 Aug 2004 06:11:37 GMT
IranASP.NET rss generator
ASP.NET
1
[email protected] : PSA.TEN
303
>knil/knil<
>etaDbup/etaDbup<
>meti/<
>lennahc/<
>ssr/ssrlennahc< SSR : >lennahcmeti< >knilelit<
. SSR >eltit< :
. SSR LRU : >knilnoitpircsed< :
. : >thgirypocrotareneg< :
>meti< . >meti< SSR
.
. >meti
[email protected] : PSA.TEN
403
. : >eltitknilnoitpircsedetaDbupmeti< . TEN.SV
)sdohtem( )seitreporp( .
:
)seitreporp(
. ) maertS ( maertstuptuO:
[email protected] : PSA.TEN
503
. >lennahc< >eltit< : eltiTssR
. >lennahc< >knil< lrUrehsilbuP:
. >lennahc< >noitpircsed< noitpircseD:
. >lennahc< >thgirypoc< : thgirypoC
. >lennahc< >rotareneg< rotareneG:
. ecruoSmetI:
>meti< >eltit< ( ) nmulocataD dleiFeltiTmetI
.
. >meti< >knil< nmulocataD dleiFLRUmetI:
>meti< >noitpircsed< nmulocataD :dleiFnoitpircseDmetI
.
>meti< >etaDbup< nmulocataD dleiFetaDnoitacilbuPmetI:
.
. maertstuptuO SSR ssRhsilbuP:
NET.ASP : [email protected]
306
RSS properties
( Public ) .
Public Class Rss
Public OutputStream As Stream
Public RssTitle As String
Public PublisherUrl As String
Public Description As String
Public Copyright As String
Public Generator As String
Public ItemSource As DataSet
Public ItemTitleField As String
Public ItemUrlField As String
Public ItemDescriptionField As String
Public ItemPublicationDateField As String
Public Shared Function PublishRss(ByVal r As Rss)
Dim writer As New XmlTextWriter(r.OutputStream,
System.Text.Encoding.ASCII)
writer.WriteStartElement("rss")
writer.WriteAttributeString("version", "2.0")
writer.WriteStartElement("channel")
writer.WriteElementString("title", r.RssTitle)
writer.WriteElementString("link", r.PublisherUrl)
writer.WriteElementString("description", r.Description)
writer.WriteElementString("copyright", r.Copyright)
writer.WriteElementString("generator", r.Generator
NET.ASP : [email protected]
307
For Each row As DataRow In r.ItemSource.Tables(0).Rows
writer.WriteStartElement("item")
writer.WriteElementString("title", row(r.ItemTitleField))
writer.WriteElementString("link", row(r.ItemUrlField))
writer.WriteElementString("description",
row(r.ItemDescriptionField))
writer.WriteElementString("pubDate",
CType(row(r.ItemPublicationDateField),
DateTime).ToString("ddd, dd MMM yyyy 12:00:00 tt G\MT"))
writer.WriteEndElement()
Next
writer.WriteEndElement()
writer.WriteEndElement()
writer.Flush()
End Function
End Class
PublishRss .
System.XML.XmlTextwriter . XML .
OutputStream encoding . ASCII
. RSS . XmlTextwriter
:
:WritestartElement )
.(
[email protected] : PSA.TEN
803
. gnirtSetubirttAetirW:
. : gnirtStnemelEetirW
. : tnemelEdnEetirW
.
. hsulF:
tnemelEdnEetirW tnemelEtratSetirW
.
TEN.PSA
.
.
. SSR
)552( rahcraV - eltit _elcitrA
)0001( rahcraV- noitpircseD _elcitrA
)552( rahcraV - lru _elcitrA
emiTetaD - etadbup _elcitrA
teSataDteG
: retpadAataD . SSR
NET.ASP : [email protected]
309
Function GetDataSet() as DataSet
Dim cnn as New SqlConnection("connection string here")
sql = "select * from sometable order by Article_pubdate desc"
Dim da As New SqlDataAdapter(sql,cnn)
Dim ds as New DataSet()
da.Fill(ds,"MyArticles")
Return ds
End Function
RSS Rss
GetDataSet .
ItemSource Rss .
response ContentEncoding ContentType .
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim r As New Rss
Dim ds As DataSet = GetDataSet()
r.OutputStream = Response.OutputStream
r.RssTitle = "DotNetBips.com Latest Articles"
r.PublisherUrl = Request.Url.Host
r.Description = "DotNetBips.com - Applying.NET"
r.Copyright = "Copyright (C) DotNetBips.com."
r.Generator = "DotNetBips.com RSS Generator"
r.ItemSource = ds
r.ItemTitleField = "Article_title"
NET.ASP : [email protected]
310
r.ItemDescriptionField = "Article_Description"
r.ItemPublicationDateField = "Article_pubdate"
r.ItemUrlField = "Article_url"
Response.ContentEncoding = System.Text.Encoding.UTF8
Response.ContentType = "text/xml"
Rss.PublishRss(r)
Response.End()
End Sub
PublishRss Rss .
! XML RSS .
: com.dotnetbips.www://http
[email protected] : PSA.TEN
113
1 - 0.2 TEN.PSA x.1 TEN.PSA
. 1,1 0,1 TEN.PSA
. TEN.PSA TEN.
. 5002 0.2 TEN.PSA
TEN.PSA .
TEN. .
.
3002 2002 1,1 0,1 TEN.PSA
. TEN.PSA TEN.
. 4002 yebdihW TEN. oidutS lausiV
1
[email protected] : PSA.TEN
213
: .
!!! ( )
!!
.
NDSM
.
0.2 TEN.PSA
: 0.2 TEN.PSA
beW -1
0.5 )SII( secivreS noitamrofnI tfosorciM
0.6 SII 0.2 TEN.PSA .
.
.
. .
.
[email protected] : PSA.TEN
313
-2
draziW 0.2 TEN.PSA
( )
beW -3
tnuoccA 0.2 TEN.PSA
. .
nigoL tnuoccA nigoL
.
-4
nikS emehT egaP retsaM 0.2 TEN.PSA
.
.
x.1 TEN.PSA
TEN.PSA x.1 TEN.PSA
TEN.PSA . x.1 TEN.PSA 0.2
[email protected] : PSA.TEN
413
0.2 TEN.PSA x.1
. 0.2 TEN.PSA
0.2 TEN.PSA . TEN.PSA
ytilitU . redivorP
. IPA
. 0.2 TEN.PSA
redivorP
beW 0.2 TEN.PSA
0.2 TEN.PSA
.
0.2 TEN.PSA redivorP
.
.
: dohteM
sredivorP 0.2 TEN.PSA
[email protected] : PSA.TEN
513
redivorP
redivorP TEN.PSA .
:
. pihsrebmeM:
. eliforP eliforP:
redivorP noitazilanosreP:
.
TEN.PSA redivorP noitagivaN etiS:
.
esabataD redivorP TEN.ODA redivorP ataD:
0.2 TEN.PSA . IPA ( )
. TEN.ODA TEN.
redivorP redivorP
. pihsrebmeM eliforP eliforP
. 0.2 TEN.PSA
0.2 TEN.PSA
[email protected] : PSA.TEN
613
: TEN.PSA x.1 TEN.PSA
)enilnI edoC( LMTH
. dniheB edoC
LMTH
.
XPSA dniheB edoC
. gaT LMTH
0.2 TEN.PSA .
.
enilnI edoC
edoC 5002 oidutS lausiV
XPSA >tpircS< dniheB
5002 oidutS lausiV . dniheB edoC
oidutS lausiV
. XPSA
[email protected] : PSA.TEN
713
>tpircS<
. .
dniheB edoC
XPSA
. xoB kcehC
[email protected] : PSA.TEN
813
edoC 0.2 TEN.PSA x.1 TEN.PSA dniheB edoC
ssalC laitraP . ssalC ssalC laitraP dniheB
. TEN.
dniheB edoC ssalC laitraP 0.2 TEN.PSA
. dniheB edoC tirehnI
NET.ASP : [email protected]
319
Partial Class Code Behind ASPX Compile
Code Behind Code
Behind . Code Behind
. Code Behind Initialization
:
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e) { }
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Hello ASP.NET 2.0";
[email protected] : PSA.TEN
023
}
}
: XPSA
{ PSA ecapseman
xpsa_1mrofbeW ssalc laitrap cilbup
{
)e sgrAtnevE ,rednes tcejbo(daoL_egaP diov
{
;"0.2 TEN.PSA olleH" = txeT.1lebaL
}
}
}
dniheB edoC . dniheB edoC
. TEN.PSA
/yrotcerid edoC
. TEN.PSA
. beW
. beW ecnerefeR
[email protected] : PSA.TEN
123
)ecapS emaN( ecnerefeR
.
.
yrotceriD 0.2 TEN.PSA
edoC/
yrotceriD . TEN.PSA
. XPSA
TEN.PSA 5002 TEN. oidutS lausiV
.
gifnoC.beW TEN.PSA
5002 TEN. oidutS lausiV 0.2 TEN.PSA evitisneS esaC
.
gifnoC.beW esnesilletnI
lausiV . esnesilletnI
.
[email protected] : PSA.TEN
223
LMX esnesilletnI
esnesilletnI gifnoC.beW .
. oidutS lausiV
. esnesilletnI
etis beW evitartsinimdA 0.2 TEN.PSA
.
etis beW evitartsinimdA
0.2 TEN.PSA
tsoh lacoL
rotartsinimdA
. eliforP
. ecarT
[email protected] : PSA.TEN
323
SII )CMM( 0.2 TEN.PSA
. krowemarF TEN.
TEN.PSA SII CMM
nottoB . gifnoC.beW
gifnoC.beW noitarugifnoC tidE
. gifnoC.beW
NET.ASP : [email protected]
324
API
System.Configuration.Configuration . API
XML .
. Authentication Local
Machine :
[C#]
Configuration cfg = Configuration.GetConfigurationForUrl("/Application_name");
Response.Write( cfg.Web.Authentication.Mode.ToString() );
[VB.NET]
Dim cfg As Configuration =
Configuration.GetConfigurationForUrl("/Application_name")
Response.Write( cfg.Web.Authentication.Mode.ToString() )
authentication Forms-Based :
[C#]
Configuration cfg = Configuration.GetConfigurationForUrl("/MyApp");
cfg.Web.Authentication.Mode = HttpAuthenticationMode.Forms;
cfg.Update();
[VB.NET]
Dim cfg As Configuration = & _
[email protected] : PSA.TEN
523
)"ppAyM/"(lrUroFnoitarugifnoCteG.noitarugifnoC
)(etadpU.gfc smroF.edoMnoitacitnehtuApttH = edoM.noitacitnehtuA.beW.gfc
.
tnempoleveD
5002 oidutS lausiV 0.2 TEN.PSA
.
. x.1 TEN.PSA
revreS
SII TEN. oidutS lausiV x.1 TEN.PSA
. snoisnetxE revreS egaPtnorF tfosorciM
SII
:
revreS tnempoleveD ehT
beW revreS 5002 TEN. oidutS lausiV
. . revreS
revreS
[email protected] : PSA.TEN
623
.
. SII
revreS noitcudorP ehT
. SII
. noitcennoC TEN. oidutS lausiV
tnioP erahS PTF snoisnetxE revreS egaPtnorF tfosorciM
. revreS
0.2 TEN.PSA
[email protected] : PSA.TEN
723
x.1 TEN.PSA
pU tratS hctaB x.1 TEN.PSA .
revreS . .
.
elipmoC-erP 0.2 TEN.PSA
)tnemyolped(
.
. TEN.PSA elipmoC-erP
[email protected] : PSA.TEN
823
1 - 0.2 TEN.PSA x.1 TEN.PSA
. 1,1 0,1 TEN.PSA
. TEN.PSA TEN.
. 5002 0.2 TEN.PSA
noitagivaN
x.1 TEN.PSA
kniLrepyH
.
x.1 TEN.PSA .
0.2 TEN.PSA . LMTH
noitagivaN
.
lacigoL( 0.2 TEN.PSA
noitagivaN . )erutcurtS
1
[email protected] : PSA.TEN
923
noitagivaN
.
noitagivaN .
. ... weiV eerT uneM
paMetiS.beW
. 0.2 TEN.PSA paMetiS
0.2 TEN.PSA noitagivaN LMX
.
lacigoL( . noitagivaN
: )erutcurtS
paMetiS.beW LMX -1
5002 TEN.oidutS lausiV .
paMetiS metI weN ddA .etiS
. esnesilletnI
>? "8-ftu"=gnidocne "0.1"=noisrev lmx?paMetis"xpsa.tluafed"=lru "emoH"=eltit edoNpaMetis<
>/ "xpsa.1elcitraomed/selcitra/~"=lru "1 elcitrA"=eltit edoNpaMetis<
>/ "xpsa.2elcitraomed/selcitra/~"=lru "2 elcitrA"=eltit edoNpaMetis<
>/ "xpsa.3elcitraomed/selcitra/~"=lru "3 elcitrA"=eltit edoNpaMetis<
NET.ASP : [email protected]
330
2- SiteMap DataSource ToolBox (Drap & Drown
.( Web.SiteMap
SiteMap DataSource Tree
View Menu .
Navigation
Navigation
ASP.NET 2.0 Navigation Navigation
.
[email protected] : PSA.TEN
133
>htaPpaMetiS:psa< . noitagivaN
. liarT murC daerB noitagivaN
LRU
. LRU noitagivaN 0.2 TEN.PSA
LRU !!(. NDSM LRU ) LRU
reldnaH IPASI PSA
gifnoC.beW gnippaM LRU 0.2 TEN.PSA .
LRU LRU
.
>"eurt"=delbane sgnippaMlru/ "0=dibat?xpsa.tluafeD/~"=lrUdeppam"xpsa.emoH/~" =lru dda<
>sgnippaMlru/redloHecalPtnetnoC:psa<
. redloHecalPtenetnoC .
5002 oidutS lausiV
: egaP retsaM . LMTH
"sc.retsam.etis"=htiwelipmoc "#C"=egaugnal retsam @%% "retsam_etis.PSA"=emanssalc
>lmthdaeh/eltit/eltit"revres"=tanur daeh
[email protected] : PSA.TEN
633
>ydob"revres"=tanur mrof<
>"revres"=tanur "1redloHecalPtnetnoC"=di redlohecalptnetnoc:psa<
>redlohecalptnetnoc:psa/<
>mrof/<
>ydob/lmth/tnetnoc:psa< . egaP retsaM
. DI redloHecalPtnetnoC egaP retsaM >redloHecalPtnetnoc:psa% "retsam.etisyM/~"=retsam "BV"=egaugnal egap @%"tnetnoCediStfeL"=diredlohecalptnetnoc "1tnetnoC"=di tnetnoc:psa2h/< noitagivaN>2H<
>/"ecruoSvaN"=diecruosatad "revres"=tanur "eert noitagivaN"=di weiveert:psa<
>tnetnoc:psa/<
>"tnetnoCediSthgiR"=diredlohecalptnetnoc "1tnetnoC"=di tnetnoc:psa<
>lebal:psa/"revres"=tanur lebal:psa<
>tnetnoc:psa/!>-- nikS tluafeD -!!>-- nikS eltiT -!draziWresUetaerC:psaytreporp< gifnoC.enihcaM gifnoC.neW
. ... eliforP
>eliforp"sserddAgnilliB"=eman puorg<
>/ "gnirtS.metsyS"=epyt "teertS"=eman dda<
[email protected] : PSA.TEN
643
>/ "gnirtS.metsyS"=epyt "otnoroT"=eulaVtluafed "ytiC"=eman dda<
>/ "gnirtS.metsyS"=epyt "vorPetatS"=eman dda<
>/ "gnirtS.metsyS"=epyt "latsoPpiZ"=eman dda<
>puorg/<
>eliforp/% "eurt"=gubeD egaP @%noitarugifnocbew.metsys<
>/"eurt"=gubed noitalipmoc<
>bew.metsys/<
>noitarugifnoc/noitarugifnocbew.metsys<
>/ "ylnOetomeR"=edom "mth.rorrecireneg"=tcerideRtluafed srorrEmotsuc<
>bew.metsys/<
>noitarugifnoc/%"egap rorrE"=noitpircseD "#C"=egaugnaL egaP @%lmthdaeheltit/eltit<
>daeh/
[email protected] : PSA.TEN
753
>ydob1h/1h<
>% ]"egaProrrE"[gnirtSyreuQ.tseuqeR=%< :no detanigiro rorrE
>ydob/lmth/srorrEmotsuc< etubirtta
etubirttA
edom
. )etomeR(
(. ylnOetomeR ) ffOnO:
tcerideRtluafed
. .
NET.ASP : [email protected]
358
Mode client client
. .
Mode Local host request Remote host request
On . .
Off ASP.NET . ASP.NET .
RemoteOnly ASP.NET . .
.
[Web.config]
[Genericeroor.htm'
An Error Has Occured
NET.ASP : [email protected]
359
We're Sorry...
An error has occured on the page you were requesting. If this problem persists,
please contact the site administrator.
[Custom1.aspx]
void Error_500(Object sender, EventArgs e) {
String foo = null;
Response.Write(foo.ToString());
}
Cause an Error to Occur...
NET.ASP : [email protected]
360
runat="server"/>
. HTTP
. :
attribute .
Attribute
StatusCode HTTP .:
403 404 Not Found Forbidden 500 .Internal Server Error
NET.ASP : [email protected]
361
Redirect client .
. aspx
"File Not Found" QueryString
.
[Custom2.aspx]
void Error_404(Object sender, EventArgs e) {
Response.Redirect("nowhere.aspx");
}
void Error_500(Object sender, EventArgs e) {
String foo = null;
Response.Write(foo.ToString());
}
Cause an Error to Occur...
NET.ASP : [email protected]
362
runat="server"/>
[Notfound.aspx]
An Error Has Occured
We could not locate the page you requested...
Perhaps you mis-typed the URL? Please try again, or visit our search page for help.
NET.ASP : [email protected]
363
[Web.config]
[email protected] : PSA.TEN
463
1 - TEN.PSA
TEN.PSA TEN.PSA
. tneilC
. goL tnevE
egaP .
. edirrevo rorrE_egaP
.
>"revres"=tanur "#C"=egaugnal tpircsrbrb
NET.ASP : [email protected]
384
if (Regex.IsMatch(Resp,"no match") || Regex.IsMatch(Resp,"not found") ||
Regex.IsMatch(Resp,"no entries found"))
{
SearchRes = " ";
PnlOrder.Visible = true;
PnlOrderOk.Visible = false;
}
else
{
SearchRes = " ";
PnlOrder.Visible = false;
PnlOrderOk.Visible = false;
}
.
TcpClt.Close();
: Build a WHOIS Lookup in ASP.NET
net-asp-lookup-whois-build/article/com.sitepoint.www
[email protected] : PSA.TEN
583
1
. ...FDP COD GPJ
redipS LRU
.
LRU
.
LRU
noitacitnehtuA . LRU
. ten.PSA
23 fdp.54fe34fds
rekcaH redipS .
.
1
[email protected] : PSA.TEN
683
. reldnaHpttH
reldnaHpttH
esnopseR/tseuqeR IPA reldnaHpttH
reldnaH .
. .cod
. PTF ecremmoC-E
gifnoC.beW
. eruceS gifnoc.bew :
>sreldnaHpttH/ "XtpecretnIfdp ,reldnaHfdp.tpecretnIfdp"=epyt "cod.*"=htap "*"=brev dda<
>sreldnaHpttH/tniop
[email protected] : PSA.TEN
593
. Y X
) .
(
)
.(
: -2
)elgnatceRreggiB,gmi(egamIwarD.scihparGym
elgnatceRreggiB )
. . (
: -3
//)01,01,001,001(elgnatceR wen=elgnatceRtsiD
)lexiP.tinUscihparG,01,01,04,57,elgnatceRtsiD ,gmi(egamIwarD.scihparGym
egamIwarD ( )
. lexiP tinUscihparG .
.
.
: -4
NET.ASP : [email protected]
396
DistRectangle =new Rectangle(10,20,120,40) )//
SourRectangle =new Rectangle(75,40,10,10) )//
myGraphics.DrawImage(img, DistRectangle, SourRectangle,GraphicsUnit.Pixel)
(Rotating) (transformation) Graphics
. transformation . 30
.
5- :
Matrix mx = new Matrix();
mx.Rotate(-30);
myGraphics.Transform = mx;
myGraphics.DrawImage(img,new Point(100,50));
.
6- :
Matrix mx = new Matrix();
mx.Translate(20.0F, 10.0F);
myGraphics.MultiplyTransform(mx);
myGraphics.RotateTransform(20.0F);
F 20,2 F 10,0 X Y .
[email protected] : PSA.TEN
793
(. )
.
: -7
;)042,023,05,05(elgnatceR wen = elgnatceRtsiD elgnatceR
;)thgieH.gmi -,htdiW.gmi ,thgieH.gmi ,0(elgnatceR wen =elgnatceRruoS elgnatceR
;)lexiP.tinUscihparG,elgnatceRruoS,elgnatceRtsiD,gmi(egamIwarD.scihparGym
. setubirttAegamI
. ahpla xirtaMroloC
33xirtaM.xirtaMroloC ytreporp
.
: -8
;))0,0(tnioP wen,1gmi(egamIwarD.scihparGym
;)(setubirttAegamI wen = ai setubirttAegamI
;)(xirtaMroloC wen = mc xirtaMroloC
;f5.0=33xirtaM.mc
;)mc(xirtaMroloCteS.ai
,0 ,0 ,) thgieH.2gmi ,htdiW.2gmi ,0 ,0(elgnatceR wen,2gmi(egamIwarD.scihparGym
;)ai ,lexiP.tinUscihparG ,thgieH.2gmi ,htdiW.2gmi
: lianbmuhT -9
[email protected] : PSA.TEN
893
. lianbmuhT
scihparG
lianbmuhT . ( 01 )
.
:
wen = kcaBllaCym trobAegamIlianbmuhTteG.egamI.gniwarD.metsyS
;)kcabllaClianbmuhT(trobAegamIlianbmuhTteG.egamI.gniwarD.metsyS
= egamIdeziseRgmi egamI.gniwarD.metsyS
;)oreZ.rtPtnI,kcaBllaCym,072,063(egamIlianbmuhTteG.ciPniaM
:
kcabllac ataDkcabllac( kcabllac : )
1+IDG 0 . trobAegamIlianbmuhTteG.egamI
(. ) .
. oreZ.rtPtnI ataDkcabllac
lianbmuhT
. lianbmuhT
( 021 021 )
.
[email protected] : PSA.TEN
993
. egamIwarD
.
: -01
;)003,003(pamtiB.gniwarD.metsyS wen = egamIweN egamI.gniwarD.metsyS
= scihparGegamIweN scihparG.gniwarD.metsyS
;)egamIweN(egamImorF.scihparG.gniwarD.metsyS
;)thgieH.egamIweN,htdiW.egamIweN,0,0(elgnatceR wen = elgnatceRtsiD elgnatceR
;)thgieH.egamIts1ym,htdiW.egamIts1ym,0,0(elgnatceR wen = elgnatceRruoS elgnatceR
nUscihparG,elgnatceRruoS,elgnatceRtsiD,egamIts1ym(egamIwarD.scihparGegamIweN
;)lexiP.ti
pamtiB egamIweN egamI
.
( ) .
. gpj.tluser
. .krowemarF TEN SII
[email protected] : PSA.TEN
004
1TEN.PSA
TEN.PSA
.
. )TNEILC(
. 4
.
) tnetsisrep( . )noisses( :
.
.
.
.
. .
.
.
. .
1
[email protected] : PSA.TEN
104
. beW.metsyS eikooCpttH
tseuqeR esnopseR
. noitcelloCeikooCpttH
noitcelloCeikooCpttH
eikooCpttH .
eulaV emaN .
eikooCpttH seripxE .
.SSAP DIU .
: ddA.seikooC.esnopseR
seikooc gnitaerC .1 gnitsiL
'
'
)"DIU"(eikooCpttH weN = eikooCpttH sA eikooc miD
"diym" = eulaV.eikooc
#2002/82/9# = seripxE.eikooc
)eikooc(ddA.seikooC.esnopseR
)"SSAP"(eikooCpttH weN = eikooc
"ssapym" = eulaV.eikooc
#2002/82/9# = seripxE.eikooc
)eikooc(ddA.seikooC.esnopseR
NET.ASP : [email protected]
402
Request.Cookies .
ListBox :
Listing2 . Read cookies
'
Dim cookieCols As New HttpCookieCollection()
cookieCols = Request.Cookies
Dim str As String
'
For Each str In cookieCols
ListBox1.Items.Add("Cookie: " + str)
ListBox1.Items.Add("Value:" & _
Request.Cookies(str).Value)
Next
Clear Remove HttpCookieCollection
. Remove :
Listing3 . Deleting cookies
Dim cookieCols As New HttpCookieCollection()
cookieCols = Request.Cookies
Dim str As String
'
NET.ASP : [email protected]
403
Request.Cookies.Remove("PASS")
Request.Cookies.Remove("UID")
. .
Values .
.
Listing4 . Creating a dictionary cookie
Dim cookDict As HttpCookie = New HttpCookie("dict")
cookDict.Values("fname") = "first name"
cookDict.Values("lname") = "last name"
cookDict.Values("Address") = "address"
Response.Cookies.Add(cookDict)
:Asp.Heaven
[email protected] : PSA.TEN
404
[email protected] : PSA.TEN
504
1LMTH
TEN.PSA LMTH
www.psanari.ten/daolnwod/slortnoclmth.piz:
.beW LMTH : TEN.PSA
. LMTH LMTH
LMTH LMTH
. TEN.PSA
. LMTH
.
>lmthdaeh/eltit/eltitdaehydob"mth.LMTHelpmiS"=noitca "tsop"=dohtem mrofrb"txet"=epyt "roloCvaf"=eman tupnip"!timbuS"=eulav "timbus"=epyt tupnimrof/ydob/lmth/lmthdaeh/eltit/eltitdaehydob"revres"=tanur mrofrb"revres"=tanur "txet"=epyt "roloCvaf"=di tupnip"revres"=tanur "!timbuS"=eulav "timbus"=epyt tupnimrof/ydob/lmth/tupni< di eman
TEN.PSA >mrof< noitcA dohteM
.
TEN.PSA LMTH LMTH .
.
[email protected] : PSA.TEN
804
1TEN.PSA
TEN.PSA
www.psanari.ten/daolnwod/slortnocbew.piz :
. LMTH
LMTH
>tceles< LMTH .
eniLtupnI xoBobmoC xoBtsiL
. >aeratxet< >tupni< xoBtxeT
TEN.PSA . TEN.PSA
.
LMTH LMTH
: TEN.PSA .
. ( ) xoBtxeT:
. lebaL :
./ xoBkcehC :
. nottuBoidaR :
. ( ( kniLrepyH :
1
[email protected] : PSA.TEN
904
LMTH nottuB :
.
LMTH nottuBkniL :
.
LMTH nottuBegamI :
.
TEN.PSA . LMTH
. nottuB xoBtxeT
>lmthdaeh/eltit/eltitdaehydob3h/3h"revreS"=tanur mrofrbprbpmrof/ydob/lmth/pnaps/"revres"=tanur "napSym"=di napsmrof/ydob/lmth/naps< xobtxet
.sgrAtnevE tcejbo : txeTtimbus
. tcejbo
. sgrAtnevE .
.
NET.ASP : [email protected]
415
HTML .
Button Click .
.
Sub submitText( s As Object, e As EventArgs )
myLabel.Text = StrReverse( myTextBox.Text )
End Sub
WebControlEvents.aspx
Enter some text:
NET.ASP : [email protected]
416
Button :
onClick Click Button
submitText . Button .
submitText Textarea
Label .
[email protected] : PSA.TEN
714
1 lebaL
lebaL
www.psanari.ten/daolnwod/lortnoclebal.piz:
lebaL TEN.PSA
txeT .
.
. daoL-egaP
>"revreS"=tanur tpircStpircS/lmthdaeh/eltit/eltitdaehydob
[email protected] : PSA.TEN
024
1tsiLyarrA xoBtsiL
. tsiLyarrA
www.psanari.ten/daolnwod/oohahs30.piz :
. daoL_egaP xoBtsiL TEN.PSA
. ) ecuos ataD ( TEN.PSA
.
. tsiLyarrA TEN.PSA
. tsiLyarrA . )noitcelloC stcejbO(
. ecruosataD xoBtsiL
dniBataD . ecruosataD
tsiLyarrA . xoBtsiL
. tsiLyarrA )srewolFtsl( xoBtsiL
.
>% "eurT"=gubeD "BV"=egaugnaL egaP@ %daeh/eltit/eltitdaehlmthydob"revres"=tanur mrof% "eurT"=gubeD "BV"=egaugnaL egaP @%lmthdaeheltit/eltitydobdaeh/rb% PSA PSA
. PSA LMTH
.
. mn .
tseuqeR .
1
[email protected] : PSA.TEN
634
. eulav
.
.
. timbus
"revres"=tanur . "revres"=tanur
:
>LMTHDAEHeltit/eltitDAEH/YDOB"revres"=tanur "xpsa.mroftset"=noitcA mroF" timbuS "=eulaV "dmc"=emaN "timbus"=epyT tupniMROF/YDOB/LMTH/
[email protected] : PSA.TEN
734
. TEN.PSA xpsa
PSA .
. =revres . xpsa
. TEN.PSA
.
mrof LMTH
__ETATSWEIV emaN DI
.
lortnoC revreS LMTH
. "revres"=tanur lortnoC revreS LMTH
. )xoblooT(
revreS LMTH . LMTH LMTH
. "revres"=tanur
LMTH lortnoC revreS LMTH
. mroF , elbaT , xoBtxeT , xoBtsiL , xoBkcehC
.
LMTH
LMTH .
[email protected] : PSA.TEN
834
ngiseD "revres"=tanur
. lortnoC revreS sA nuR
. slortnoCLMTH.IU.beW.metsyS LMTH
lortnoC revreS LMTH LMTH
:
.
tneilc
.
.
PSA lortnoC revreS LMTH
. TEN.PSA PSA .
lortnoC revreS TEN.PSA lortnoC revreS LMTH
.
slortnoC revreS TEN.PSA
LMTH lortnoC revreS LMTH
slortnoC revreS TEN.PSA .
.
[email protected] : PSA.TEN
934
xoBtxeT revreS TEN.PSA TEN.BV
:psa< . dirGataD
txeT lebaL xpsa.1mroFbeW .
: dlroWolleH
>/"revres"=tanur "dlroW olleH"=txet "egasseM"=di lebal:psa/"revres"=tanur "!oG"=txet nottub:psa"revres"=tanur mroF< . )dleiF neddiH(
: . TEN.PSA
>"01tc_"=di "xpsa.egap"=noitca "tsop"=dohtem "01tc_"=eman mroFmrof/');
System.Web.HttpUtility.HtmlEncode(i.Text,writer);
writer.WriteEndTag("option");
writer.WriteLine();
}
}
}
}
! HtmlTextWriter
.
listbox value selected Attribute
HTML ListBox !
:
[C#]
IEnumerator d = Items[c].Attributes.Keys.GetEnumerator();
while(d.MoveNext())
writer.WriteAttribute(d.Current.ToString(),Items[c].Attributes[d.Current.ToString()]);
NET.ASP : [email protected]
476
. ListBox
listbox ColoredListBox.StyledListBox
. codebehind .
[C#]
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.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace ColoredListBox
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected StyledListBox ListBox1;
private void Page_Load(object sender, System.EventArgs e)
NET.ASP : [email protected]
477
{
// Put user code to initialize the page here
ListItem item;
item = new ListItem ("IranASP.NET 1", "1");
item.Attributes.Add ("Style", "background-color:#39B54A; color:#ffffff");
this.ListBox1.Items.Add (item);
item = new ListItem ("IranASP.NET 2", "2");
item.Attributes.Add ("Style", "color:#0000ff");
this.ListBox1.Items.Add (item);
item = new ListItem ("IranASP.NET 3", "3");
item.Attributes.Add ("Style", "background-color:#ff0000; color:#ffffff");
this.ListBox1.Items.Add (item);
}
}
}
aspx listbox
. StyledListBox
:
[email protected] : PSA.TEN
874
xobtsil . lortnoC resU
:
>xoBtsiLdelytS:psanari/"revres"=tanur "1xoBtsiL"=di xoBtsiLdelytS:psanarimrof< .
www.psanari.ten/lairotut/elcitra.xpsa@dielcitra=701 1
NET.ASP : [email protected]
481
HTML .
ASP.NET .
JavaScrip (comment) HTML
.
.
[C#]
public void Page_Load(Object sender, EventArgs e) {
// Form the script that is to be registered at client side.
String scriptString = " function DoClick() {";
scriptString += "myForm.show.value='Welcome to Microsoft .NET'}";
NET.ASP : [email protected]
482
if(!this.IsClientScriptBlockRegistered("clientScript"))
this.RegisterClientScriptBlock("clientScript", scriptString);
}
IsClientScriptBlockRegistered :
(key) RegisterClientScriptBlock
. RegisterClientScriptBlock
.
RegisterStartupScript : RegisterClientScriptBlock
. .
[C#]
NET.ASP : [email protected]
483
public void Page_Load(Object sender, EventArgs e) {
// Form the script to be registered at client side.
String scriptString = " function DoClick() {";
scriptString += "showMessage2.innerHTML='Welcome to Microsoft
.NET!'}";
scriptString += "function Page_Load(){ showMessage1.innerHTML=";
scriptString += "'RegisterStartupScript Example'}";
if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", scriptString);
}
[email protected] : PSA.TEN
484
>ydob/lmth/tpircs" + "/" =+ gnirtStpircs
;)"!TEN. tfosorciM ot emocleW" ,"dleiFneddiHym"(dleiFneddiHretsigeR
nottub timbuS>4h4h/
NET.ASP : [email protected]
486
using System.Web.UI.WebControls;
namespace Common
{
///
/// Utility class for ASP.NET pages
///
/// Be sure to notice that this code is provided as a technology sample
/// and 'as is' and no warranties are made by the author.
///
///
public class PageUtil
{
// This static methods helps you build your JavaScript blocks easily
public static string MakeJavaScriptBlock(string strJavascript)
{
string sScript;
sScript = "\n\n";
sScript += "\n";
sScript += "\n";
return sScript;
}
// This staic method is used in popup screens
// to close popup after doing some thing
NET.ASP : [email protected]
487
public static void CloseCurrent(System.Web.UI.Page page)
{
string sScript = "window.close();";
sScript = Common.PageUtil.MakeJavaScriptBlock (sScript);
page.RegisterStartupScript ("CloseCurrent", sScript);
}
public static void ShowAlert(string msg, System.Web.UI.Page page)
{
if (page.Request.Browser.JavaScript == true)
{
string sScript = "alert(\"" + msg + "\");\n";
sScript = Common.PageUtil.MakeJavaScriptBlock (sScript);
page.RegisterStartupScript ("ShowAlertScript", sScript);
}
}
}
}
NET.ASP : [email protected]
488
1DataList
DataList
DataList .
.
DataList . DataSource
Table DataSet DataBind DataBase
.
:
[Code Behind - VB.NET]
Dim Conn As New OleDbConnection
Dim Comm As New OleDbCommand
Dim ds As New DataSet
Dim adp As New OleDbDataAdapter
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Conn.ConnectionString = "Your ConnectionString"
Comm.CommandText = "Select Top 10 * from TableName"
Comm.Connection = Conn
adp.SelectCommand = Comm
1
NET.ASP : [email protected]
489
adp.Fill(ds, "Blog")
Conn.Close()
DataList1.DataSource = ds.Tables("Blog").Defa