<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ไอเอินบล๊อก &#187; Java</title>
	<atom:link href="http://www.iearn.in.th/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iearn.in.th</link>
	<description>Just Play and Just Knowledge</description>
	<lastBuildDate>Sat, 12 Jun 2010 06:40:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Java Communications API on Windows</title>
		<link>http://www.iearn.in.th/2009/09/01/java-communications-api-on-windows/</link>
		<comments>http://www.iearn.in.th/2009/09/01/java-communications-api-on-windows/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:11:21 +0000</pubDate>
		<dc:creator>nolifelover</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[comm]]></category>
		<category><![CDATA[java communication api]]></category>
		<category><![CDATA[rs232]]></category>
		<category><![CDATA[serial port]]></category>

		<guid isPermaLink="false">http://www.iearn.in.th/?p=581</guid>
		<description><![CDATA[ผมเปลี่ยนโปรแจคมาทำเรื่องเกี่ยวกะ การอ่าน RFID โดยการติดต่อจะเขียนโปรแกรมโดยใช้ Java จึงจำเป็นต้องรู้เรื่องของการอ่านข้อมูลมากจาก RS232 หรือว่า Serial Port นั้นเองโดยการใช้งานจึงต้องมีการใช้งาน Java Communication API สำหรับการติดต่อครับโดยใน windows XP จะทำการ set ดังนี้ 1. โหลดไฟล์ www.iearn.in.th/wp-download/commapi.rar 2. แตกไฟล์จะมีไฟล์ให้อ่านทำตามนั้นได้เลยครับ แต่หากว่าไม่ได้ลองอ่านตามผมก็ได้ครับ การ setup comm api 1. ให้ไปที่คุณได้ลง JDK ไว้ครับเช่นผมลงไว้ที่ C:\Program Files\Java\jdk1.6.0_14 2. นำเอาไฟล์ win32com.dll ไปไว้ที่ \jre\bin 3. นำเอาไฟล์ comm.jar ไปไว้ที่ \jre\lib\ext 4. นำเอาไฟล์ javax.comm.properties ไปไว้ทีท \jre\lib เป็นอันว่าสามารถเขียนโปรแกรมติดต่อ Serial Port ได้แล้วละครับ [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iearn.in.th/wp-content/uploads/2009/09/java-comm-api.png"><img src="http://www.iearn.in.th/wp-content/uploads/2009/09/java-comm-api-300x148.png" alt="java-comm-api" title="java-comm-api" width="300" height="148" class="aligncenter size-medium wp-image-582" /></a><br />
ผมเปลี่ยนโปรแจคมาทำเรื่องเกี่ยวกะ การอ่าน RFID โดยการติดต่อจะเขียนโปรแกรมโดยใช้ Java จึงจำเป็นต้องรู้เรื่องของการอ่านข้อมูลมากจาก RS232 หรือว่า Serial Port นั้นเองโดยการใช้งานจึงต้องมีการใช้งาน Java Communication API สำหรับการติดต่อครับโดยใน windows XP จะทำการ set ดังนี้<br />
<span id="more-581"></span><br />
1. โหลดไฟล์ www.iearn.in.th/wp-download/commapi.rar<br />
2. แตกไฟล์จะมีไฟล์ให้อ่านทำตามนั้นได้เลยครับ แต่หากว่าไม่ได้ลองอ่านตามผมก็ได้ครับ</p>
<p><strong>การ setup comm api</strong><br />
1. ให้ไปที่คุณได้ลง JDK ไว้ครับเช่นผมลงไว้ที่ C:\Program Files\Java\jdk1.6.0_14<br />
2. นำเอาไฟล์ win32com.dll ไปไว้ที่ \jre\bin<br />
3. นำเอาไฟล์ comm.jar ไปไว้ที่ \jre\lib\ext<br />
4. นำเอาไฟล์ javax.comm.properties ไปไว้ทีท \jre\lib</p>
<p>เป็นอันว่าสามารถเขียนโปรแกรมติดต่อ Serial Port ได้แล้วละครับ</p>
<p>ที่มา http://java.sun.com/products/javacomm/</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.iearn.in.th/2009/09/01/java-communications-api-on-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read File and check path</title>
		<link>http://www.iearn.in.th/2008/05/03/read-file-and-check-path/</link>
		<comments>http://www.iearn.in.th/2008/05/03/read-file-and-check-path/#comments</comments>
		<pubDate>Sat, 03 May 2008 06:24:24 +0000</pubDate>
		<dc:creator>nolifelover</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[BufferedReader]]></category>
		<category><![CDATA[lineBuffer]]></category>
		<category><![CDATA[read file]]></category>
		<category><![CDATA[write file]]></category>

		<guid isPermaLink="false">http://www.jaideawhosting.com/nolifelover/?p=137</guid>
		<description><![CDATA[หลังจากหายหน้าหายตาไปหลายวันไม่ได้ไปไหนนะครับแต่ว่าช่วงนี้งานส่วนของ Asterisk ที่เน้น ruby เป็นหลังต้องทำให้ค้องแบ่งเวลาในการเขียนบล๊อกทั้งหมดไปทำในส่วนนี้สำหรับวันที่วันเสาร์เรียน scjp เสร็จเลยมีอารมณ์อยากที่จะเขียนบล๊อก่อจากวันก่อนครับ สำหรับวันนี้จะเขียนเกี่ยวกับโค้ดของ softskill ต่อละกันนะครับ สำหรับวันนี้โจทย์จะเป็นไปในลักษณะให้เราอ่าน ไฟล์จาก input.txt ซึ่งมี path ของ file อยู่และให้อ่านอีกไฟล์คือไฟล์ rules.txt เพื่อทำการตวรจสอบว่าไฟล์นั้นผ่านกฏต่างๆ ที่ได้กำหนดไว้ในไฟล์ rules.txt หรือไม่หากว่าตรงให้เอาเฉพาะไฟล์ที่อณุญาตเท่านั้นครับ เรามาดูกันเลยดีกว่าครับ โดยในที่นี้ผมจะใช้ Pathmanager ที่ได้เขียนไว้ในการจัดการเรื่อง permission ครับ สำหรับไฟล์ใหม่ที่เขียนขึ้นตามนี้ครับ package softwareskill; &#160; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; &#160; /** * * @author mLri */ public [...]


Related posts:<ol><li><a href='http://www.iearn.in.th/2009/09/01/java-communications-api-on-windows/' rel='bookmark' title='Permanent Link: Java Communications API on Windows'>Java Communications API on Windows</a> <small>ผมเปลี่ยนโปรแจคมาทำเรื่องเกี่ยวกะ การอ่าน RFID โดยการติดต่อจะเขียนโปรแกรมโดยใช้ Java จึงจำเป็นต้องรู้เรื่องของการอ่านข้อมูลมากจาก RS232 หรือว่า Serial Port...</small></li>
<li><a href='http://www.iearn.in.th/2009/08/23/set-path-on-ubuntu/' rel='bookmark' title='Permanent Link: Set Path On Ubuntu'>Set Path On Ubuntu</a> <small>สำหรับบทความนี้เป็นวิธีการ set path ใน ubuntu สำหรับคนที่ยังทำไม่ค่อยจะเป็นนะครับวิธีการมี 2 วิธีคือการเปิด terminal มาแล้ว...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>หลังจากหายหน้าหายตาไปหลายวันไม่ได้ไปไหนนะครับแต่ว่าช่วงนี้งานส่วนของ Asterisk ที่เน้น ruby เป็นหลังต้องทำให้ค้องแบ่งเวลาในการเขียนบล๊อกทั้งหมดไปทำในส่วนนี้สำหรับวันที่วันเสาร์เรียน scjp เสร็จเลยมีอารมณ์อยากที่จะเขียนบล๊อก่อจากวันก่อนครับ สำหรับวันนี้จะเขียนเกี่ยวกับโค้ดของ softskill ต่อละกันนะครับ สำหรับวันนี้โจทย์จะเป็นไปในลักษณะให้เราอ่าน ไฟล์จาก input.txt ซึ่งมี path ของ file อยู่และให้อ่านอีกไฟล์คือไฟล์ rules.txt เพื่อทำการตวรจสอบว่าไฟล์นั้นผ่านกฏต่างๆ ที่ได้กำหนดไว้ในไฟล์ rules.txt หรือไม่หากว่าตรงให้เอาเฉพาะไฟล์ที่อณุญาตเท่านั้นครับ เรามาดูกันเลยดีกว่าครับ โดยในที่นี้ผมจะใช้ Pathmanager ที่ได้เขียนไว้ในการจัดการเรื่อง permission ครับ สำหรับไฟล์ใหม่ที่เขียนขึ้นตามนี้ครับ</p>
<p><span id="more-137"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">softwareskill</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.BufferedReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileNotFoundException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileWriter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author mLri
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SecueManager <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> rule<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> input<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> output<span style="color: #339933;">;</span>
    PathManager pathManager<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">FileNotFoundException</span>, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        SecueManager secueManager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span>  SecueManager<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/Users/mLri/rule.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        secueManager.<span style="color: #006633;">processFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/Users/mLri/input.txt&quot;</span>, <span style="color: #0000ff;">&quot;/Users/mLri/output.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> SecueManager<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> rule<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">FileNotFoundException</span>, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">rule</span> <span style="color: #339933;">=</span> rule<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">pathManager</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PathManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">readRule</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> processFile<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> input,<span style="color: #003399;">String</span> output<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">FileNotFoundException</span>, <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">input</span> <span style="color: #339933;">=</span> input<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">output</span> <span style="color: #339933;">=</span> output<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">pathProcess</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> readRule<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">FileNotFoundException</span>, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">File</span> file <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>rule<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> fileBuffer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileReader</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> lineBuffer<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>lineBuffer <span style="color: #339933;">=</span> fileBuffer.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>lineBuffer.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                pathManager.<span style="color: #006633;">addAcceptedRule</span><span style="color: #009900;">&#40;</span>lineBuffer.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;is complete addAcceptRule is &quot; + lineBuffer.substring(1));</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>lineBuffer.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                pathManager.<span style="color: #006633;">addDeniedRule</span><span style="color: #009900;">&#40;</span>lineBuffer.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;is complete addDeniedRule is &quot; + lineBuffer.substring(1));</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        fileBuffer.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;readRule is Successful&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> pathProcess<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">FileNotFoundException</span>, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">File</span> file <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> fileBuffer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileReader</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">ArrayList</span> allowFile <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> lineBuffer<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>lineBuffer <span style="color: #339933;">=</span> fileBuffer.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pathManager.<span style="color: #006633;">isAllow</span><span style="color: #009900;">&#40;</span>lineBuffer<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;add line &quot; + lineBuffer);</span>
                allowFile.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>lineBuffer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        fileBuffer.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">pathWrite</span><span style="color: #009900;">&#40;</span>allowFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> pathWrite<span style="color: #009900;">&#40;</span><span style="color: #003399;">ArrayList</span> allowFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">FileWriter</span> file <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileWriter</span><span style="color: #009900;">&#40;</span>output,<span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> accept<span style="color: #339933;">:</span>allowFile<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            file.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>accept<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        file.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;File output is Suscessful in &quot;</span><span style="color: #339933;">+</span>output<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>สำหรับไฟล์ SecueManager จะเป็นตัวที่ทำหน้าที่ในการอ่านไฟล์และเขียนไฟล์ ส่วนไฟล์ที่ทำการ check จริงๆจะเป็นไฟล์ <a href="http://www.jaideawhosting.com/nolifelover/?p=126">PathManager</a> ครับ</p>


<p>Related posts:<ol><li><a href='http://www.iearn.in.th/2009/09/01/java-communications-api-on-windows/' rel='bookmark' title='Permanent Link: Java Communications API on Windows'>Java Communications API on Windows</a> <small>ผมเปลี่ยนโปรแจคมาทำเรื่องเกี่ยวกะ การอ่าน RFID โดยการติดต่อจะเขียนโปรแกรมโดยใช้ Java จึงจำเป็นต้องรู้เรื่องของการอ่านข้อมูลมากจาก RS232 หรือว่า Serial Port...</small></li>
<li><a href='http://www.iearn.in.th/2009/08/23/set-path-on-ubuntu/' rel='bookmark' title='Permanent Link: Set Path On Ubuntu'>Set Path On Ubuntu</a> <small>สำหรับบทความนี้เป็นวิธีการ set path ใน ubuntu สำหรับคนที่ยังทำไม่ค่อยจะเป็นนะครับวิธีการมี 2 วิธีคือการเปิด terminal มาแล้ว...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.iearn.in.th/2008/05/03/read-file-and-check-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File permission with regular expression</title>
		<link>http://www.iearn.in.th/2008/04/25/file-permission-with-regular-expression/</link>
		<comments>http://www.iearn.in.th/2008/04/25/file-permission-with-regular-expression/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 11:37:30 +0000</pubDate>
		<dc:creator>nolifelover</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[File]]></category>
		<category><![CDATA[Hashset]]></category>
		<category><![CDATA[mLri]]></category>
		<category><![CDATA[pathManager]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[softwareskill]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.jaideawhosting.com/nolifelover/?p=126</guid>
		<description><![CDATA[สำหรับโจทย์ในวันนี้ืคือการเขียนโปรแกรมต่อจากของเมื่อวานเกี่ยวกับการตวจสอบ permission ของ file ว่าเราสามารถ access เข้าใช้ได้หรือไม่โดย หากตรงกับกฏของการ denied ให้ทำการ denied เลย แต่หากไม่ตรงก็ให้ทำการตวจสอบว่าสามารถเข้าใช้ได้หรือไม่ ครับโดยมี source code สำหรับข้อนี้เป็นโจทย์มาให้คือ 1 2 3 4 5 6 7 8 9 10  public static void main&#40;String&#91;&#93; args&#41;  &#123;   PathManager pathManager = new PathManager&#40;&#41;;   pathManager.addDeniedRule&#40;&#34;\\w.*\\.exe$&#34;&#41;;   pathManager.addAcceptedRule&#40;&#34;^\\d&#34;&#41;;   if&#40;pathMananager.isAllow&#40;&#34;c:/temp/12.exe&#34;&#41;&#41;   System.out.println&#40;&#34;accepted&#34;&#41;;   else   System.out.println&#40;&#34;denied&#34;&#41;;  &#125; สำหรับกฏต่างๆ user สามารถเขียน [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>สำหรับโจทย์ในวันนี้ืคือการเขียนโปรแกรมต่อจากของเมื่อวานเกี่ยวกับการตวจสอบ permission ของ file ว่าเราสามารถ access เข้าใช้ได้หรือไม่โดย หากตรงกับกฏของการ denied ให้ทำการ denied เลย แต่หากไม่ตรงก็ให้ทำการตวจสอบว่าสามารถเข้าใช้ได้หรือไม่ ครับโดยมี source code สำหรับข้อนี้เป็นโจทย์มาให้คือ</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 	PathManager pathManager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PathManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	pathManager.<span style="color: #006633;">addDeniedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>w.*<span style="color: #000099; font-weight: bold;">\\</span>.exe$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	pathManager.<span style="color: #006633;">addAcceptedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^<span style="color: #000099; font-weight: bold;">\\</span>d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>pathMananager.<span style="color: #006633;">isAllow</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;c:/temp/12.exe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
 		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;accepted&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 	<span style="color: #000000; font-weight: bold;">else</span>
 		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;denied&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-126"></span></p>
<p>สำหรับกฏต่างๆ user สามารถเขียน method เพื่ีอ add rule ไปได้เรื่อยๆ ครับ สำหรับการเขียนของผมในวันนี้ใช้เรื่องของ Hashset, regular expression เบื้องต้น และใช้ method String.matches(String reg) เพื่อตรวจสอบว่าตรงกับ regular expression ที่เราต้องการหรือไม่ สำหรับโค้ดที่ได้ประมาณนี้ครับ</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">softwareskill</span><span style="color: #339933;">;</span>  
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashSet</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author mLri
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PathManager <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//field</span>
    <span style="color: #003399;">HashSet</span> deniedRule<span style="color: #339933;">;</span>
    <span style="color: #003399;">HashSet</span> acceptedRule<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        PathManager pathManager <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PathManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        pathManager.<span style="color: #006633;">addDeniedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>w*<span style="color: #000099; font-weight: bold;">\\</span>.exe$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        pathManager.<span style="color: #006633;">addDeniedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>w*<span style="color: #000099; font-weight: bold;">\\</span>.bat$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        pathManager.<span style="color: #006633;">addDeniedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>w*<span style="color: #000099; font-weight: bold;">\\</span>.msi$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        pathManager.<span style="color: #006633;">addAcceptedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^<span style="color: #000099; font-weight: bold;">\\</span>d.*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        pathManager.<span style="color: #006633;">addAcceptedRule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>w*(<span style="color: #000099; font-weight: bold;">\\</span>.jpg||<span style="color: #000099; font-weight: bold;">\\</span>.pdf||<span style="color: #000099; font-weight: bold;">\\</span>.png)$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//pathManager.addAcceptedRule(&quot;\\w*\\.png$&quot;);</span>
        <span style="color: #666666; font-style: italic;">//pathManager.addAcceptedRule(&quot;\\w*\\.pdf$&quot;);</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pathManager.<span style="color: #006633;">isAllow</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;c:/tem/2aaa.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;accepted&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;denied&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> PathManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">deniedRule</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">HashSet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">acceptedRule</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">HashSet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> addDeniedRule<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> exp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">deniedRule</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>exp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> addAcceptedRule<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> exp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">acceptedRule</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>exp<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isAllow<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> file<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> tmp <span style="color: #339933;">=</span> file.<span style="color: #006633;">split</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tmp <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            file <span style="color: #339933;">=</span> tmp<span style="color: #009900;">&#91;</span>tmp.<span style="color: #006633;">length</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">checkDeniedRule</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">checkAcceptRule</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> checkAcceptRule<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> file<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>acceptedRule.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> rule <span style="color: #339933;">:</span> acceptedRule<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;file is &quot; + file);</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;rule is &quot; + rule);</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>file.<span style="color: #006633;">matches</span><span style="color: #009900;">&#40;</span>rule<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #666666; font-style: italic;">//System.out.println(&quot;rule is accepted&quot;);</span>
                    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> checkDeniedRule<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> file<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>deniedRule.<span style="color: #006633;">isEmpty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> rule <span style="color: #339933;">:</span> deniedRule<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;file is &quot; + file);</span>
                <span style="color: #666666; font-style: italic;">//System.out.println(&quot;rule is &quot; + rule);</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>file.<span style="color: #006633;">matches</span><span style="color: #009900;">&#40;</span>rule<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #666666; font-style: italic;">//System.out.println(&quot;rule is denied&quot;);</span>
                    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>HashSet คือ class ประมาณเดียวกับ Array สามารถเช็คการซำ้กันของสมาชิกได้หากซ้ำกันจะไม่ Add เพิ่มลงไปครับ<br />
Regular Expression คือสมการที่ใช้ในการตรวจสอบรูปแบบ format ของ string ว่าตรงตามที่เราต้องการหรือไม่โดยจะสามารถนำไปใช้ในการตรวจสอบ email การอัพโหลดไฟล์ ชนิดของไฟล์ประมาณนั้นครับ<br />
<a href="http://www.amk.ca/python/howto/regex/">http://www.amk.ca/python/howto/regex/</a><br />
<a href="http://www.aprelium.com/abyssws/articles/regex-basics.html">http://www.aprelium.com/abyssws/articles/regex-basics.html</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.iearn.in.th/2008/04/25/file-permission-with-regular-expression/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
