30 พฤษภาคม 2557

Form Login สวยๆ (HTML)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>User Login</title>

<style type="text/css">
<!--
#apDiv1 {
position: absolute;
top: 50%;
left: 50%;
width: 300px;
height: 200px;
margin-left: -250px;
margin-top: -150px;
background-color: #468879;
border-radius:5px;
-khtml-border-radius:5px;
-moz-border-radius:5px;
}
.style1 {color: #FFFFFF}
.style4 {color: #F5F5F5}
-->
</style>
</head>
<body bgcolor="#F0F0F0" >
<form id="form1" name="form1" method="post" action="">
<div id="apDiv1">
<h1 align="center" class="style4">USER LOGIN</h1>
<table width="284" border="0" align="center">
<tr>
<td width="124"><span class="style1">User Name</span></td>
<td width="144" colspan="2">
<label>
<input type="text" name="txtusername" id="txtusername" autofocus />
</label> </td>
</tr>
<tr>
<td><span class="style1">Password</span></td>
<td colspan="2"><input type="password" name="txtpassword" id="txtpassword" /></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td>

<div align="left">
<input type="reset" name="reset" id="reset" value="Reset" />
</div></td>
<td><div align="right">
<input type="submit" name="button" id="button" value="LOGIN" />
</div></td>
</tr>
</table>

<label></label>
<p>&nbsp;</p>
</div>
</form>
</body>
</html>

22 พฤษภาคม 2557

วิธีการกำหนด Firewall เปิด Port ให้กับ MS SQL Server

วิธีการกำหนด Firewall ให้กับ MS SQL Server

Start >run > firewall.cpl

Windows Firewall With Advances Security
>Advanced Setting >Inbound Rules>


Actions >New Rules...
(มุมขวาอันแรก)
เพิ่ม Port ดังนี้

UDP  port
1434 - SQL Server Admin Connection
135 - Transact Debugger/RPC
2382 - SQL Server Browser
2383 - SQL Analysis Services
4022 - SQL Service Broker

TCP port
80 - SQL Server instance running over an HTTP endpoint.
135 - Transact-SQL debugger
443 - SQL Server default instance running over an HTTPS endpoint.
1433 - SQL Server Default Instrace
1434-SQL Server Browser service
4022 - Service Broker

19 พฤษภาคม 2557

Face Detect โดย ใช้ EMGU

' ตอนนี้ผมกำลังศึกษาเพิ่มเติมอยู่หากใครมีส่วน Recognition ก็ขอด้วยครับผมมาได้แค่นี้
Imports Emgu.CV
Imports Emgu.CV.Structure
Imports Emgu.Util
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Runtime.InteropServices

Public Class frmWebcam

    Dim capturez As Capture = New Capture

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        'Dim img As New Image(Of Bgr, Byte)(imgFilename)
        Dim img As Image(Of Bgr, Byte) = capturez.QueryFrame()

        'Load the object detector
        Dim faceDetector As New CascadeClassifier("C:\Emgu\emgucv-windows-universal-cuda 2.9.0.1922\bin\haarcascade_frontalface_default.xml")

        'Convert the image to Grayscale
        Dim imgGray As Image(Of Gray, Byte) = img.Convert(Of Gray, Byte)()

        For Each face As Rectangle In faceDetector.DetectMultiScale( _
                           imgGray, _
                           1.1, _
                           10, _
                           New Size(20, 20), _
                           Size.Empty)
            img.Draw(face, New Bgr(Color.White), 1)
        Next
        PictureBox1.Image = img.ToBitmap()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
    End Sub

    Private Sub btnCapture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapture.Click
        'PictureBox2.Image = PictureBox1.Image
        Dim imagez As Image(Of Bgr, Byte) = capturez.QueryFrame()
        PictureBox2.Image = imagez.ToBitmap()

    End Sub
End Class

 เจอแล้วละแต่ดูเหมือนผมจะติดอะไรนิดหน่อย
http://www.youtube.com/watch?v=PV5arUlBIkk