09/10/2018, 23:04

Có ai biết gì về công nghệ web blog không ?

Có ai biết gì về công nghệ web blog không xin giảng dùm, có bạn nào có source thì cho mình xin luôn. Cám ơn nhé
kid08 viết 01:17 ngày 10/10/2018
Yahoo đó, coi đi bạn roài học tập
cuuchienbinh viết 01:12 ngày 10/10/2018
Cách tạo 1 blog đơn giản, không đòi hỏi database:
Xem livedemo : http://betnow.homeip.net/

- Đòi hỏi bạn phải có cài đặt IIS, .NET framework, trước khi chạy nhớ edit lại password của bạn

SOURCE CODE:
Code:
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Serialization" %>

<HTML>
<HEAD>
<TITLE>Blog</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<BODY BGCOLOR="#2E499A" TEXT="#FFFFFF" LINK="#FFCC66" VLINK="#FFFFFF">

<Script runat="Server">
Public day_create_blog as String
Public SelectFileOnDay As String

Public objTunsBlog As TunsBlog
Public objStreamReader As StreamReader
Public objXMLSerializer As XMLSerializer  
Public dtmDate As Date

Public Class TunsBlog
  Public Username As String
  Public BlogTitle As String
  Public MainBlog As String
  Public ImageURL As String
End Class
</Script>




<div align="center" style="text-decoration:none ">
<form Runat="Server">
<Script Runat="Server">

Sub Calendar_SelectionChanged( s As Object, e As EventArgs )



  For Each dtmDate in calCalendar.SelectedDates
	SelectFileOnDay = dtmDate.ToString("MM-dd-yyyy") & ".xml"
	day_create_blog = dtmDate.ToString("MM-dd-yyyy")
  Next
  
	try
	  objStreamReader = File.OpenText( MapPath( SelectFileOnDay ) )
	  objXMLSerializer = New XMLSerializer( GetType( TunsBlog ) )
	  objTunsBlog = CType( objXMLSerializer.Deserialize( objStreamReader ), TunsBlog )
	  objStreamReader.Close()
  

	  txtBlogTitle.Text = objTunsBlog.BlogTitle
	  txtMainBlog.Text = replace(objTunsBlog.MainBlog,"br_","<br>")

	  txtpasstextbox.Visible="true"
      button_check_pass.visible="true"
	  txtpasstextbox.text = "password to edit"
	catch
	    txtBlogTitle.Text = "Sorry, no entry on this day<br>"
  		txtMainBlog.Text = "If you have a password, type it here"
		
		'txtblogtitle_cps.Visible="True"
		'txtMainBlog_cps.visible="true"
		txtpasstextbox.Visible="true"
		button_ok_cps.visible ="false"
		button_check_pass.visible="true"
	end try  
End Sub




Sub Page_Load
	txtblogtitle_cps.visible="false"
	button_ok_cps.visible ="false"
	txtMainBlog_cps.visible="false"
	button_check_pass.visible="false"
	txtPassTextBox.visible="false"

	Dim MyDate as Date
	MyDate = Date.Now
	Dim MyStringFile As String
	MyStringFile  = MyDate.ToString("MM-dd-yyyy") + ".xml"

 try
  objStreamReader = File.OpenText( MapPath( MyStringFile ) )
  objXMLSerializer = New XMLSerializer( GetType( TunsBlog ) )
  objTunsBlog = CType( objXMLSerializer.Deserialize( objStreamReader ), TunsBlog )
  objStreamReader.Close()
  
  txtBlogTitle.Text = objTunsBlog.BlogTitle
  txtMainBlog.Text = replace(objTunsBlog.MainBlog,"br_","<br>")

 catch 
 end try  
End Sub




Sub checkpass_click( s As Object, e As EventArgs )
  If txtPassTextBox.Text = "password" then
  
    txtBlogTitle.Text = "Welcome, please compose your blog"
	txtblogtitle_cps.visible="true"

	
	button_ok_cps.visible ="true"
	txtMainBlog_cps.visible="true"	

	Dim dtmDate As Date		
	For Each dtmDate in calCalendar.SelectedDates
		day_create_blog = dtmDate.ToString("MM-dd-yyyy") & ".xml"		
 	 Next
	try
	
	  objStreamReader = File.OpenText( MapPath( day_create_blog ) )
	  objXMLSerializer = New XMLSerializer( GetType( TunsBlog ) )
	  objTunsBlog = CType( objXMLSerializer.Deserialize( objStreamReader ), TunsBlog )
	  objStreamReader.Close()
  

'	  txtBlogTitle.Text = objTunsBlog.BlogTitle
	  txtMainBlog.Text = replace(objTunsBlog.MainBlog,"br_","<br>")

'	  txtpasstextbox.Visible="true"
'      button_check_pass.visible="true"
'	  txtpasstextbox.text = "password to edit"
	catch
	end try
  Else
    txtBlogTitle.Text = "Incorrect password. <a href=""javascript:history.go(-1)"">Try again</a>"
	txtMainBlog.Text = Nothing
  End If
End Sub



Sub create_new_blog( s As Object, e As EventArgs )
try
  Dim objTunsBlog As TunsBlog
  Dim objStreamWriter As StreamWriter
  Dim objXMLSerializer As XMLSerializer
  Dim dtmDate As Date
  For Each dtmDate in calCalendar.SelectedDates
		day_create_blog = dtmDate.ToString("MM-dd-yyyy") & ".xml"		
  Next

  objTunsBlog = New TunsBlog
  objTunsBlog.BlogTitle = txtblogtitle_cps.Text
  objTunsBlog.MainBlog = replace(txtMainBlog_cps.Text,chr(13)," br_ ")

  objStreamWriter = File.CreateText( MapPath( day_create_blog ) )
  objXMLSerializer = New XMLSerializer( GetType( TunsBlog ) )
  objXMLSerializer.Serialize( objStreamWriter, objTunsBlog )
  objStreamWriter.Close
catch
 
end try  
End sub



</Script>

<table width="0" border="0">
  <tr>
    <td valign="top" width="450" style="padding-left:15px; word-spacing:2pt; letter-spacing: 2pt">
	<div style="font-family:'Century Gothic'; font-size:18px; ">

<asp:Label
  id="txtBlogTitle"
  runat="server" />
<br>




<asp:TextBox
id="txtblogtitle_cps" Columns="40"
runat="server" />

<br>
<asp:Textbox TextMode="MultiLine" Rows="10" Columns="40" 
  id="txtMainBlog_cps"
  Runat="Server" />
<br>

<asp:Button
ID="button_ok_cps"
text="Post this entry"
runat="server"
onClick="create_new_blog"
 />
<br>










</div></td>
    <td rowspan="2" valign="top"><table><tr><td>
  <asp:Calendar
  id="calCalendar"
  BorderColor="#2E499A"

  Width="15%" 
  Font-Name="Century Gothic"
  Font-Size="9pt"
  DayNameFormat="FirstLetter"
  CellPadding="4"
  DayHeaderStyle-Font-Bold="true"

  TodayDayStyle-ForeColor="#80FF00"
  TitleStyle-BackColor="#2E499A"
  TitleStyle-ForeColor="#80FF00"
  WeekendDayStyle-ForeColor="#FF8080"
  DayStyle-ForeColor="#FFFFFF"
  SelectedDayStyle-BackColor="#0000FF"
  
  FirstDayOfWeek="Monday"
  Enabled="true"
  OtherMonthDayStyle-ForeColor="#818181"

  SelectionMode="Day"
  
  OnSelectionChanged="Calendar_SelectionChanged"
  
  Runat="Server" /></td></tr>
  <tr><td align="center"></td></tr></table></td>
  </tr>
  <tr>
    <td valign="top" width="450" style="padding-right:100px; ">

		<table  border="0" align="left" cellpadding="0" cellspacing="0">
  <tbody>
    <tr valign="top">
      <td colspan="3">
          <!-- st_story -->
		  <div style="font-family:'Century Gothic'; font-size:13px; font-family:'Tahoma'; ">	
	  <asp:Label
		  id="txtMainBlog"
		  Runat="Server" />
		  <br>
		  <asp:TextBox
  ID="txtPassTextBox"
  Text="password"
  Columns="16"
  Visible="false"
  Runat="Server" />

<asp:Button
id="button_check_pass"
text="Check"
runat="server"
visile="false"
onClick="checkpass_click" 
cssClass="nut"


/></div>
            <!-- end_story -->
            <br>
        </p>
          <div class="six">&nbsp;</div></td>
    </tr>
  </tbody>
</table>
		</td>
  </tr>
</table>

</form>





<br><br><br>
<div align="center">  <font face="Arial, Helvetica, sans-serif" size="-2"><br> 
  </font>
  <table width="0" border="0">
    <tr>
      
        
      <td><span class="style3"> Right to Copy &copy; 2006 by <a href="http://360.yahoo.com/tuan2***" class="style3">T&uacute;ns</a> YM <a href="ymsgr:im?to=cuuchienbinh_vn" title="Send IM">cuuchienbinh_vn</a> <span class="style4">0903.45.67.89</span></span></td>
            <td><span class="style3"><img src="101.gif" width="28" height="18"></span></td>
        
 
   
   
      <td><div align="center"></div></td>
    </tr>
  </table>
  </div>
</BODY>
</HTML>
quann_gnam viết 01:20 ngày 10/10/2018
goi ban kid08 Minh biet yahoo, google va nhieu trang khac nua co tinh nang Blog
nhung y minh la tin source code de tao ra web blog cho moi nguoi kia
ban co tai lieu hay de mo ko goi minh voi
thanks!

cam on ban cuubienbinh rat nhieu nhung link ban cho minh khong mo duoc
ban co tai lieu hay demo ve web blog ko goi minh voi

thanks!

Hoi the gian tinh ai la gi
ma ngan nam doi lua the nghuyen song chet
Haaaaa::...
kid08 viết 01:15 ngày 10/10/2018
ý mình là nếu bạn là dân lập trình, bạn có thể xem qua các tính năng của các blog đó và tự viết 1 blog system, mình cũng có ý định làm, mong đc trao đổi với bạn
cuuchienbinh viết 01:12 ngày 10/10/2018
link chay. tot' do' ban.
Bài liên quan
0