2009年10月30日 星期五

VS2008 pageLayout FlowLayout GridLayout

VS2008 pageLayout

設定方式:
工具 - 選項 - CSS 樣式 - 利用貼上......絕對位置.
(用物件上方白色標籤移動)

2009年10月27日 星期二

VS2008 ftp file UPLOAD

With the FtpWebRequest and FtpWebResponse classes:

Private Sub Upload(ByVal source As String, ByVal target As String, _
ByVal credential As NetworkCredential)
Dim request As FtpWebRequest = _
DirectCast(WebRequest.Create(target), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = credential
Dim reader As New FileStream(source, FileMode.Open)
Dim buffer(Convert.ToInt32(reader.Length - 1)) As Byte
reader.Read(buffer, 0, buffer.Length)
reader.Close()
request.ContentLength = buffer.Length
Dim stream As Stream = request.GetRequestStream
stream.Write(buffer, 0, buffer.Length)
stream.Close()
Dim response As FtpWebResponse = DirectCast(request.GetResponse, FtpWebResponse)
MessageBox.Show(response.StatusDescription, "File Uploaded")
response.Close()
End Sub

Dim credential As New NetworkCredential("username", "password")
Upload("test.zip", "ftp://myftp.net/test.zip%22, credential)

轉自: VB.NET

VS2008 SQL連結字串更新

VS2003:
WEB.CONFIG
    <appSettings>
        <add key="SQL_ConnectionString" value="Persist Security Info=True;User ID=sa;Initial Catalog=DDD;Data Source=SSS"/>

VB
            strConStr = System.Configuration.ConfigurationSettings.AppSettings("SQL_ConnectionString").ToString()

VS2008:
WEB.CONFIG
    <connectionStrings>
        <add name="SQL_ConnectionString" connectionString="Persist Security Info=True;User ID=sa;Initial Catalog=DDD;Data Source=SSS"/>

VB
Imports System.Configuration

            strConStr = ConfigurationManager.ConnectionStrings("SQL_ConnectionString").ConnectionString

2009年10月13日 星期二

如何關閉瀏覽器不詢問, 直接關閉?

一般開新視窗有:
如果用 target="_blank" 開啟視窗 則會出現提示
假如用window.open 開啟視窗 則關閉時 不會出現提示

如果用 target="_blank" 開啟視窗,
關閉時 不出現提示可以用:

window.open('','_self','');
window.close();