2012年1月17日 星期二

第一天玩 joomla 的會員功能...Gmail 寄不出去

開發環境
XP SP3
Xampp (C:\xampp\....安裝路徑)



C:\xampp\php.ini裡面的 加入 extension=php_openssl.dll 


害我搞半天,他乃乃的雄,三更半夜搞我,你當我明天不用上班喔


http://www.joomla123.com.tw/site-manage/send-joomla-mail-by-gmail-smtp.html
原廠網址


郵件模式:SMTP

寄件地址: somebody@gmail.com
發件人 名稱:somebody
SMTP認證:
SMTP Security: SSL
SMTP Port: 465
SMTP 用戶名: somebody@gmail.com
SMTP 密碼:**********
SMTP 主機:smtp.gmail.com






2012年1月10日 星期二

VB.net INI 讀寫

參考
http://chengchao.blogspot.com/2008/08/vbnet-ini.html


' vb.net 中读写 ini 文件和 vb6 中的做法是一致的,也要使用 Windows Api 的方法
' 唯一要注意的是:在 vb.net 中,api 声明中的 Long 型要改为 int32 类型。

Public Class Form1
    Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" ( _
    ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpdefault As String, _
    ByVal lpretrunedstring As String, ByVal nSize As Int32, _
    ByVal lpFilename As String) As Int32


    Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" ( _
    ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpString As String, _
    ByVal lpFilename As String) As Int32






    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WritePrivateProfileString("Section", "Key", "Value", Application.StartupPath + "\a.ini")


    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim strIni As String
        strIni = New String(" ", 100)
        GetPrivateProfileString("Section", "Key", "", strIni, 100, Application.StartupPath + "\a.ini")
        MsgBox(strIni)
    End Sub
End Class

2012年1月9日 星期一

Vb.net 2008 Microsoft.Jet.OLEDB.4.0' 提供者並未登錄於本機電腦上

 windows 7 專業版 X64
  vb.net  2008
  framework3.5




難得複習 一下 access 結果 顯示電腦
Microsoft.Jet.OLEDB.4.0' 提供者並未登錄於本機電腦上
上網查了一下 VB 論壇


http://social.msdn.microsoft.com/forums/zh-TW/238/thread/c55decf8-53a4-4c82-8aa3-d9f3e6c627c0


Microsoft Jet 不支援 64 位元的版本,你的應用程式不能編譯為 64 位元的應用程式,而必須編譯為 32 位元的應用程式,才可以使用 Microsoft Jet,你可以看看:


不過還是找不到,最後自己摸了一下
專案==> project name + 屬性 == > 進階編譯選項===> 目標 CPU 選擇  X86(原本是 ANYCPU)
打完收工,謝謝


2012年1月8日 星期日

VB.net 基本的 對話框 字體 顏色 開啟檔案


Public Class Form1

    Private Sub btn_FontDialog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_FontDialog.Click
        FontDialog1.ShowColor = True
        FontDialog1.ShowApply = True
        '套用的功能就是 視窗不會關閉 會產生 apply的事件
        '這樣使用者就不會因為按下確定(視窗會關閉)以後 還要在重新 showdailog 一次
        '算是體貼使用者設計
        FontDialog1.ShowDialog()
    End Sub

    Private Sub FontDialog1_Apply(ByVal sender As Object, ByVal e As System.EventArgs) Handles FontDialog1.Apply
        Label1.Font = FontDialog1.Font
        Label1.ForeColor = FontDialog1.Color
    End Sub

    Private Sub btn_ColorDialog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ColorDialog.Click
        ColorDialog1.FullOpen = True '展開所有功能
        ColorDialog1.ShowDialog()
        Label2.BackColor = ColorDialog1.Color
    End Sub

    Private Sub btn_OpenFileDialog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_OpenFileDialog.Click
        OpenFileDialog1.Reset()
        OpenFileDialog1.Multiselect = True
        OpenFileDialog1.Title = "來選擇一個或多個檔案吧"
        OpenFileDialog1.FileName = Application.StartupPath + "\test.text"
        OpenFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"

        If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
            ListBox1.Items.Clear()

            For Each myfilename In OpenFileDialog1.FileNames
                ListBox1.Items.Add(myfilename)
            Next
        End If

    End Sub

End Class