VB 如何轉存文字檔案為 UTF-8 編碼格式

如果你在寫 ASP 或 VB 且一定要將文字儲存成 UTF-8 編碼,這個 Function 應該可以幫你的忙:


Function SaveTextAsUTF8(filePath, Text)
Const adTypeText = 2
Const adSaveCreateOverWrite = 2

'Create Stream object
Dim TextStream
Set TextStream = CreateObject("ADODB.Stream")
With TextStream
.Open
.CharSet = "UTF-8"
.Position = TextStream.Size
.WriteText Text
.SaveToFile filePath, adSaveCreateOverWrite
.Close
End With
Set TextStream = Nothing
End Function

遠端桌面連線

遠端桌面連線,就是一般流傳的 Remote Control (遠端連線 )。
它是應用的 RDP (Remote Desktop Protocol) 技術,所形成的實務技巧。

以下,主要是說明該如何建立 *.rdp 檔案,將連線之所有設定存在其中,日後就可以直接 雙擊 ,直接連線在遠端的電腦中。

步驟一:開啟 遠端桌面連線 程式 (mstsc.exe)



步驟二:輸入要連線的 IP、帳號、密碼等認證資料,
並按下 選項 鈕。



步驟三:點選 連線設定值 區中的 另存新檔
指定檔名後,加以存檔。



一般情況,連線設定值 區的 儲存 鈕,會將當下連線的設定值,儲存在
C:\Documents and Settings\LOGIN_UserName\My Documents 目錄中,
檔名為 Default.rdp

Win 2003 & IIS 6,為何會開啟 asp 檔有 404 錯誤?

Win 2003 & IIS 6,為何會開啟 asp 檔有 404 錯誤? 但是開啟 *.htm 檔案,則是正常。

這問題,主要是因為IIS 6中的 Activex Service Page 未被 允許 使用。
按下Allow 鈕,啟動即可。


Win 2003 & IIS 6,為何會開啟 aspx 檔有 404 錯誤?

Win 2003 & IIS 6,為何會開啟 aspx 檔有 404 錯誤?
但是開啟 *.htm, *.asp 檔案,則是正常。

這問題,主要是因為IIS 6中的 ASP.NET v1.1.4322 (or v2.0.50727) 未被 允許 使用。
按下Allow 鈕,啟動即可。

但是,這問題之前,上圖中的兩個 ASP.NET v.... 的項目,並未條列在上面?
要如何產生這兩個選項?

首先要確定有安裝 .NetFramework 1.0,1.1,2.0 等其一版本,並且可以在
C:\WINDOWS\Microsoft.NET\Framework 下就可以看到相關版本的目錄內容

(以下,以 2.0 為例)
進入 v2.0.50727 目錄,並執行 "aspnet_regiis -i" (可進入 command line 運作)
之後,記得再重新啟動 IIS 的管理窗口。就可以看到相關的選項顯示在上頭。

ASP.NET v2.0.50727

ERP 開發報表 注意事項

ERP 開發報表 注意事項

1. 指定 特定規格 的報表紙張 (A3, B3)
2. 指定 特殊尺寸 的報表紙張

開發端要安裝相關的列表機 Driver,並 設定 好需要的紙張尺寸規格項目,以供使用。[用以確保 設計階段 的正常]

設定特殊尺寸的方法,詳相關說明文件。

報表設計時,需指明使用的紙張尺寸;同理,在 AP 端也要安裝相關的 列表機 Driver。[用以確保 報表列印階段 的正常]

TextCopy 用法說明

TextCopy 是一個 MS-SQL 的工具程式,主要是用來做數據的匯入、匯出工作。


C:\>textcopy /?
TEXTCOPY Version 1.0
DB-Library version 8.00.194

Copies a single text or image value into or out of SQL Server. The value
is a specified text or image 'column' of a single row (specified by the
"where clause") of the specified 'table'.

If the direction is IN (/I) then the data from the specified 'file' is
copied into SQL Server, replacing the existing text or image value. If the
direction is OUT (/O) then the text or image value is copied from
SQL Server into the specified 'file', replacing any existing file.

TEXTCOPY [/S [sqlserver]] [/U [login]] [/P [password]]
[/D [database]] [/T table] [/C column] [/W"where clause"]
[/F file] [{/I /O}] [/K chunksize] [/Z] [/?]

/S sqlserver The SQL Server to connect to. If 'sqlserver' is not
specified, the local SQL Server is used.
/U login The login to connect with. If 'login' is not specified,
a trusted connection will be used.
/P password The password for 'login'. If 'password' is not
specified, a NULL password will be used.
/D database The database that contains the table with the text or
image data. If 'database' is not specified, the default
database of 'login' is used.
/T table The table that contains the text or image value.
/C column The text or image column of 'table'.
/W "where clause" A complete where clause (including the WHERE keyword)
that specifies a single row of 'table'.
/F file The file name.
/I Copy text or image value into SQL Server from 'file'.
/O Copy text or image value out of SQL Server into 'file'.
/K chunksize Size of the data transfer buffer in bytes. Minimum
value is 1024 bytes, default value is 4096 bytes.
/Z Display debug information while running.
/? Display this usage information and exit.

You will be prompted for any required options you did not specify.

C:\>

遠端電腦磁碟的連接設定 - Net Use

有時候,需要和另外一台電腦(可以把它當成"遠端")連接,並取得該電腦上的某些檔案。就需要一些設定步驟將環境架好,才能正常連線。

首先,要被連線上去的電腦(遠端電腦),就要將它許可讓人連接並使用的特定目錄,加以設定為目錄共享

一般來說,只要設定共享,每個人都可以使用;必要時,可以設定只有特定人員及密碼才能連線。

再者,就是設定要連線遠端電腦的"近端"(Local)電腦環境,要依下列指令 增設一台磁碟機代號(R:)

NET USE R: \\遠端電腦位址\共享目錄名稱
NET USE R: \\遠端電腦位址\共享目錄名稱 /USER:ID Password

等增設好新設的磁碟機代號後,就可以在檔案總管中,用 拖拉、copy/paste 來管理檔案。