Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Forum > จิบกาแฟ นั่งคุยเรื่อง การเขียน ASP แบบ OOP เอาหลักการและ ตัวอย่างมาปันกันดีกว่าครับ



 

จิบกาแฟ นั่งคุยเรื่อง การเขียน ASP แบบ OOP เอาหลักการและ ตัวอย่างมาปันกันดีกว่าครับ

 



Topic : 026170



โพสกระทู้ ( 367 )
บทความ ( 0 )



สถานะออฟไลน์




เอาหลักการและ ตัวอย่างมาปันกันดีกว่าครับ
เอากาแฟมานั่งจิบแล้ว คุยกันครับ ใครมีเวลา หรือ เห็นตัวอย่างที่ใหรเอามาแปะกัน



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2009-04-07 14:16:50 By : Joe_Dev View : 2292 Reply : 12
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ผมเขียนไว้คร่าว ๆ เป็นตัวอย่างครับ ASP Microsoft Access Database Class






Date : 2009-04-07 16:23:51 By : webmaster
 


 

No. 2

Guest


โทดนะค่ะ พอจะเขียน JSP ได้มั้ยค่ะ

คือตอนนี้มีปัญหากับมันมาก ต้องการความช่วยเหลือด่วนเลยค่ะ

ขอบคุณล่วงหน้านะค่ะ
Date : 2009-05-23 17:00:52 By : ติ๊ก
 

 

No. 3



โพสกระทู้ ( 4,719 )
บทความ ( 8 )



สถานะออฟไลน์


ผมเคยทำเอาไว้ โดยศึกษาและเลียนแบบจาก FCKEditor
ลองเอาไปดัดแปลงดู

Code (ASP)
<%
class webcalendar
	
	private swidth
	private sheight
	private sheadcolor
	private scellday
	private scelltodaycolor
	private scellselectcolor
	private scellcolor
	private slinkcolor
	private sheadtextcolor
	private sbordercolor
	
	' อย่าเปลี่ยนค่าบรรทัดล่างนี้
	private qmonth
	private qyear
	
	Private Sub Class_Initialize()
		swidth = "100%"
		sheight = "210px"
		sheadcolor = "#78b600"
		scellday = "#93c105"
		scelltodaycolor = "#6ac710"
		scellselectcolor = "#d8f53a"
		scellcolor = "#c8f53a"
		slinkcolor = "#e2f7ba"
		sheadtextcolor = "#e2f7ba"
		sbordercolor = "#517b00"
		
		' อย่าเปลี่ยนค่าบรรทัดล่างนี้
		qmonth = request.querystring("qmonth")
		if qmonth = "" then qmonth = month(date)
		qyear = request.querystring("qyear")
		if qyear = "" then qyear = year(date)
	End Sub
	
	public property Let width( widthvalue )
		swidth = widthvalue
	end property
	
	public property Let height( heightvalue )
		sheight = heightvalue
	end property
	
	public property let headcolor(headcolorvalue)
		sheadcolor = headcolorvalue
	end property
	
	public property let cellday(celldaycolorvalue)
		scellday = celldaycolorvalue
	end property
	
	public property let celltodaycolor(celltodaycolorvalue)
		scelltodaycolor = celltodaycolorvalue
	end property
	
	public property let cellselectcolor(cellselectcolorvalue)
		scellselectcolor = cellselectcolorvalue
	end property
	
	public property let cellcolor(cellcolorvalue)
		scellcolor = cellcolorvalue
	end property
	
	public property let linkcolor(linkcolorvalue)
		slinkcolor = linkcolorvalue
	end property
	
	public property let headtextcolor(headtextcolorvalue)
		sheadtextcolor = headtextcolorvalue
	end property
	
	public property let bordercolor(bordercolorvalue)
		sbordercolor = bordercolorvalue
	end property
	
	' สร้างตัวเขียนออกมาเป็น <html> โดยดึงจากฟังก์ชั่น createhtml อีกที
	public sub create()
		response.write createhtml()
	end sub
	
	' ปล่อยค่า html ที่ออกมาเป็นตารางไป
	public function createhtml()
		
		html = ""
		html = html & "<div style=""width:" & swidth & "; text-align:center;"" align=""center"">" & vbcrlf
		html = html & "<table border=""1"" width=""100%"" style="" height:" & sheight & "; border-collapse:collapse; border:1px solid " & sbordercolor & ";"">" & vbcrlf
		html = html & "  <tr>" & vbcrlf
		html = html & "    <td colspan=""7"" style=""background-color:" & sheadcolor & ";"">"
		html = html & "    <table border=""0"" width=""100%"" style=""font-weight:bold;""><tr><td style=""text-align:left;"">"
		html = html & "    <a style=""text-decoration:none; color:" & slinkcolor & ";"" href=""?"
		if qmonth - 1 = 0 then
			html = html & "qmonth=12&qyear=" & qyear -1 & """>"
		else
			html = html & "qmonth=" & qmonth - 1 & "&qyear=" & qyear & """>"
		end if
		html = html & "      &laquo;"
		html = html & "    </td>"
		html = html & "    <td style=""text-align:center; color:" & sheadtextcolor & ";"">" & monthname(qmonth) & " " & qyear & "</td>"
		html = html & "    <td style=""text-align:right"">"
		html = html & "    <a style=""text-decoration:none; color:" & slinkcolor & ";"" href=""?"
		if qmonth + 1 = 13 then
			html = html & "qmonth=1&qyear=" & qyear + 1 & """>"
		else
			html = html & "qmonth=" & qmonth + 1 & "&qyear=" & qyear & """>"
		end if
		html = html & "      &raquo;"
		html = html & "    </td></tr></table>"
		html = html & "    </td>" & vbcrlf
		html = html & "  </tr>" & vbcrlf
		'--------------------หัววันที่ อาทิตย์ถึงจันทร์
		html = html & "  <tr style=""text-align:center; background-color:" & scellday & ";"">" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">อ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">จ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">อ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">พ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">พ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">ศ</td>" & vbcrlf
		html = html & "    <td style=""width:" & formatnumber(100/7, 3) & "%;"">ส</td>" & vbcrlf
		html = html & "  </tr>" & vbcrlf
		firstday = weekday(dateserial(qyear, qmonth, 1)) -1
		currentday = 1
		for calndrrows = 0 to 5
			html = html & "  <tr>" & vbcrlf
			for calndrcols = 0 to 6
				if calndrrows = 0 and  calndrcols < firstday then' ช่องว่างก่อนวันที่เริ่มต้นของเดือน
					html = html & "    <td style=""text-align:center; background-color:" & scellcolor & ";"">&nbsp;</td>" & vbcrlf
				elseif currentday > lastday(qmonth, qyear) then' ช่องว่างหลังวันสิ้นสุดเดือน
					html = html & "    <td style=""text-align:center; background-color:" & scellcolor & ";"">&nbsp;</td>" & vbcrlf
				else
					'---------------------------'
					html = html & "    <td"
					if qmonth = month(date) and currentday = day(date) and qyear = year(date) then' วันที่ปัจจุบัน
						html = html & " style=""text-align:center; background-color:" & scelltodaycolor & ";"">"
					elseif qdate = currentday then
						html = html & " style=""text-align:center; background-color:" & scellselectcolor & ";"">"
					else
						html = html & " style=""text-align:center; background-color:" & scellcolor & ";"">"
					end if
					'-------------' จะเพิ่มเติมการคลิกวันที่ก็ทำในช่องนี้
					html = html & currentday
					'-------------' จะเพิ่มเติมการคลิกวันที่ก็ทำในช่องนี้
					html = html & "</td>" & vbcrlf
					'---------------------------'
					currentday = currentday + 1
				end if
			next
			html = html & "  </tr>" & vbcrlf
		next
		html = html & "</table>" & vbcrlf
		html = html & "</div>" & vbcrlf
		
		createhtml = html
	end function
	
	function monthname(qmonth)
		select case qmonth
			case 1
				monthname = "January"
			case 2
				monthname = "Febuary"
			case 3
				monthname = "March"
			case 4
				monthname = "April"
			case 5
				monthname = "May"
			case 6
				monthname = "June"
			case 7
				monthname = "July"
			case 8
				monthname = "August"
			case 9
				monthname = "September"
			case 10
				monthname = "October"
			case 11
				monthname = "November"
			case 12
				monthname = "December"
			case else
				monthname = "Error!"
		end select
	end function
	
	function lastday(qmonth, qyear)
		' returns the last day of the month. takes into account leap years
		' example: lastday(12,2000) or lastday(12) or lastday
		select case qmonth
			case 1, 3, 5, 7, 8, 10, 12
				lastday = 31
			case 4, 6, 9, 11
				lastday = 30
			case 2
				if isdate("29" & "/" & qmonth & "/" & qyear+calendaryearvalue) then lastday = 29 else lastday = 28
			case else
				lastday = 0
		end select
	end function
end class
%>

เป็นการทำงานแสดงปฏิทิน
เวลาใช้งานก็..
Code (ASP)
<%
set calendar = new webcalendar
calendar.width = "500px"'<--ตรงนี้คือกำหนดค่าความกว้าง ถ้าไม่กำหนดมันจะใช้ค่าเดิม
' การตั้งค่าให้ลองเปรียบเทียบตัวอย่างบรรทัดบนกับการตั้งค่าอื่นๆอีกมากมายที่เขียนไว้แล้วลองกำหนดดู
calendar.create
set calendar = nothing
%>

ผมก็เพิ่งหัดเขียนแบบนี้ ก็งูๆปลาๆมั่วๆไป ก็พอจะเริ่มเข้าใจครับ
Date : 2009-05-24 02:12:50 By : mr.v
 


 

No. 4



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ASP/VBScript Class
Date : 2009-05-24 10:48:51 By : webmaster
 


 

No. 5



โพสกระทู้ ( 367 )
บทความ ( 0 )



สถานะออฟไลน์


ส่วนมากไม่ค่อยทำเป็น OOP เพราะไม่ค่อยมีเวลามาก
ปั่นๆ ให้ได้งานก็ไปทำอย่างอื่นต่อ
Date : 2010-09-11 15:26:45 By : Joe_Dev
 


 

No. 6



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


เขาหันไปเขียน .net กันหมดมั้ง ของตกรุ่นก็เลยไม่มีใครพัฒนาต่อ มันก็เลยได้เท่านี้
Date : 2010-09-11 16:07:08 By : tungman
 


 

No. 7



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


ยังมีคนใช้อยู่นะครับ asp classic แบบว่าใช้มานาน และการเปลี่ยนของเก่าไปเป็น asp.net ใช้งบเยอะ เลยต้องคงของเดิมไว้ แต่ application ใหม่ก็ใช้ .net แทน

ว่าแต่จะโอโอทั้งทีไม่ไป .net เลยละครับ
Date : 2010-09-12 01:40:53 By : PlaKriM
 


 

No. 8



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ตอนนี้ผมก็ยังเขียน ASP Classic อยู่ครับ เขียนให้บริษัทหนึ่งครับ เหตุผลเพราะระบบเค้าใหญ่มากกก จะเปลี่ยนก็ไม่คุ้มแน่นอน
Date : 2010-09-12 06:56:07 By : webmaster
 


 

No. 9



โพสกระทู้ ( 1,348 )
บทความ ( 1 )



สถานะออฟไลน์


บางทีใช้ของ Classic มันก็ดีเหมือนกันนิ
Date : 2010-09-14 17:11:07 By : watcharop
 


 

No. 10



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ยังไง
Date : 2010-09-14 19:15:06 By : tungman
 


 

No. 11



โพสกระทู้ ( 5 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter

สื่บทอด ใช้คำสั่งไหน มีไหมครับ คลาส จะใช้ไปอะไรครับ superclass and subclass
Date : 2010-11-08 02:41:25 By : wangfunchao
 


 

No. 12

Guest


มีเว็บโหลดโปรแกรมเขียนasp ไหมครับ
Date : 2010-11-11 10:35:33 By : Leisuresongs
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : จิบกาแฟ นั่งคุยเรื่อง การเขียน ASP แบบ OOP เอาหลักการและ ตัวอย่างมาปันกันดีกว่าครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่