VISUAL STUDIO 2013 VISUAL BASIC GRIDE EXCELDEN YAPIŞTIR

VISUAL STUDIO 2013 VISUAL BASIC GRIDE EXCELDEN YAPIŞTIR

ONCE BU FONKSIYONU EKLE;
———————-
Sub pastefromclipboardtodatagridview(ByVal dgv As DataGridView)
        Dim rowSplitter As Char() = {vbCr, vbLf}
        Dim columnSplitter As Char() = {vbTab}

        ‘get the text from clipboard

        Dim dataInClipboard As IDataObject = Clipboard.GetDataObject()
        Dim stringInClipboard As String = CStr(dataInClipboard.GetData(DataFormats.Text))

        ‘split it into lines
        Dim rowsInClipboard As String() = stringInClipboard.Split(rowSplitter, StringSplitOptions.RemoveEmptyEntries)

        ‘get the row and column of selected cell in grid
        Dim r As Integer = dgv.SelectedCells(0).RowIndex
        Dim c As Integer = dgv.SelectedCells(0).ColumnIndex

        ‘add rows into grid to fit clipboard lines
        If (dgv.Rows.Count < (r + rowsInClipboard.Length)) Then
            dgv.Rows.Add(r + rowsInClipboard.Length – dgv.Rows.Count)
        End If

        ‘ loop through the lines, split them into cells and place the values in the corresponding cell.
        Dim iRow As Integer = 0
        While iRow < rowsInClipboard.Length
            ‘split row into cell values
            Dim valuesInRow As String() = rowsInClipboard(iRow).Split(columnSplitter)
            ‘cycle through cell values
            Dim iCol As Integer = 0
            While iCol < valuesInRow.Length
                ‘assign cell value, only if it within columns of the grid
                If (dgv.ColumnCount – 1 >= c + iCol) Then
                    dgv.Rows(r + iRow).Cells(c + iCol).Value = valuesInRow(iCol)
                End If
                iCol += 1
            End While
            iRow += 1
        End While

    End Sub

—————

1 ADET DATAGRIDVIEW YARAT
1 ADET BUTTON YARAT
CİFT TIKLA BUTTONA
KOD:
        DataGridView1.AllowUserToAddRows = False
        DataGridView1.Rows.Add()
        pastefromclipboardtodatagridview(DataGridView1)
        DataGridView1.AllowUserToAddRows = False
        DataGridView1.Rows.Add()
        pastefromclipboardtodatagridview(DataGridView1)

VB .NET’de Yazı özgünleştirme ve özgünleştirme testi yapma kodları SEO

Forma eklenmesi gerekenler; Kaynak kodları için bana ulaşabilirsiniz…

Kodlar:

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        WebBrowser1.Document.GetElementById(“makale”).SetAttribute(“value”, MemoEdit1.Text)
        ‘WebBrowser1.Document.GetElementById(“İşlemi Yap”).InvokeMember(“click”)

        ‘kontor attıktan sonra cıkan ekranda tamamama bas
        For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName(“input”)

            If Element.OuterHtml.Contains(“İşlemi Yap”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element
        WebBrowser2.Navigate(“http://www.jetseotools.com/free-seo-plagiarism-checker&#8221;)
        Timer1.Enabled = True

 

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName(“input”)

            If Element.OuterHtml.Contains(“Demo Göster”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element

        Timer1.Enabled = False
        Timer2.Enabled = True
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick

        Dim Elems As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName(“textarea”)
        For Each Elem As HtmlElement In Elems
            ‘Loop through until you find the one that needs updating (in your case it is named proxylist)
            If Elem.Id = “demo” Then
                ‘Update the TextArea Text
                ‘   Elem.InnerHtml = “My Text”
                MemoEdit2.Text = Elem.InnerHtml
                Exit For
            End If
        Next Elem
        MemoEdit2.Text = Split(MemoEdit2.Text, “kelime say”)(0)
        Timer2.Enabled = False
        Timer3.Enabled = True
    End Sub

    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
        Dim Elems As HtmlElementCollection = WebBrowser2.Document.GetElementsByTagName(“textarea”)
        For Each Elem As HtmlElement In Elems
            ‘Loop through until you find the one that needs updating (in your case it is named proxylist)
            If Elem.Id = “mycontent” Then
                ‘Update the TextArea Text
                ‘   Elem.InnerHtml = “My Text”
                Elem.InnerHtml = MemoEdit2.Text
                Exit For
            End If
        Next Elem

        For Each Element As HtmlElement In WebBrowser2.Document.GetElementsByTagName(“a”)

            If Element.OuterHtml.Contains(“Check for Plagiarism”) Then

                Element.InvokeMember(“click”)
                Exit For

            End If

        Next Element
        WebBrowser2.Focus()
        SendKeys.Send(“^-“)

        WebBrowser1.Navigate(“http://wmtikk.com/arac/yazi-ozgunlestirici&#8221;)

        Timer3.Enabled = False
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader(“saniye.txt”)
        Dim stringReader1 As String

        stringReader1 = fileReader.ReadLine()
        Timer1.Interval = stringReader1

    End Sub
End Class

vb net klasöürdeki dosya bilgilierini listboxa yazdırmak için

1 Dim finfo As New IO.DirectoryInfo("C:\Story")
2 For Each fi In finfo.GetFiles
3   Listbox1.Items.Add(fi.FullName)
4 Next
ayrıca textboxun multilineni acıncada yapılabilir
1 Dim finfo As New IO.DirectoryInfo("C:\Story")
2 For Each fi In finfo.GetFiles
    TextBox2.AppendText(myFolder & sFileExtension & Environment.NewLine) ‘pcye kaydedilen yer

Next

[VB.net] How to make a Firefox Webbrowser

This tutorial will teach you how to make a Firefox Webbrowser. Unlike the Internet Explorer (default one) this one is faster and better.

Requirements

1. Visual Basic
2. Coding Experience in vb.net
3. A Brain

Tutorial

1. First go to http://webkitdotnet.sourceforge.net/downloads.php and click on Win32 Binary File
[​IMG]

2. Open the download zip using 7-zip or some archiver.
3. Extract it to a local directory.
4. Open Visual Basic (or Visual Studio)
5. Click on New Project
[​IMG]

6. Create a new project
7. You will see a window similar like this.
[​IMG]

8. Click on Tools > Choose Toolbox Items
[​IMG]
9. Click on browse and locate to the folder where you extracted the zip file.
10. Go to Extracted Folder > bin > WebKitBrowser.dll
11. Click ok
12. Save Project
13. Copy all files from the directory of Webkit
[​IMG]

14. Go to your Project Folder.
15. Navigate to C:\Users\”YOUR USERNAME”\Documents\Visual Studio 2010\Projects\”PROJECT NAME”\”PROJECT NAME”\bin\Debug folder
16. Paste it there.
17. Now go back to the project
17a. Check your Toolbox.
17b. You will find there is a Webbrowser Control is the last section of the Toolbox. Add it to your program.
18. Double click the form.
[​IMG]

19. Type the following code.
[​IMG]

20. Now test your project.
21. You will get something like this.
[​IMG]

I know most of you will make a bot using this tutorial and go on with your life :alone: but giving a thanks and rep is highly appreciated.:thumbs:

ref http://thebot.net/threads/vb-net-how-to-make-a-firefox-webbrowser.142359/

vb net devexpress grid data bind from sqlserver

Önce Forma bir adet GridControl ekle   sonra forma tıkla ve aşağıdaki gibi olsun




Imports System.Data.SqlClient
Imports System.IO
Public Class Form1

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Reader As StreamReader = File.OpenText("sql.txt")
        Dim FileText As String = Reader.ReadToEnd()
        Reader.Close()
        MemoEdit1.Text = FileText

        Dim connectionString As String = "Data Source=KLCTRCK;Initial Catalog=LKSDB;User ID=semsem;Password=xaaxpass"
        Dim sql As String = MemoEdit1.Text
        Dim connection As New SqlConnection(connectionString)
        Dim dataadapter As New SqlDataAdapter(sql, connection)
        Dim ds As New DataSet()
        connection.Open()
        dataadapter.Fill(ds, "Firma")
        connection.Close()

        GridControl1.DataSource = ds
        GridControl1.DataMember = "Firma"

        GridView1.OptionsView.ColumnAutoWidth = False 'Gridviewei otomatik genişlik ayarı
        GridView1.OptionsView.BestFitMaxRowCount = -1
        GridView1.BestFitColumns()

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'xls olarak kaydet
        SaveFileDialog1.Filter = "XLS Files (*.xls*)|*.xls"
        If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
        Then
            GridControl1.ExportToXls(SaveFileDialog1.FileName)
        End If
    End Sub
End Class



visual basic read two lines from text file

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader("C:\Users\Digikey\Desktop\MyApplication6\testfile.txt")
        Dim stringReader1, stringReader2 As String




        stringReader1 = fileReader.ReadLine()
        stringReader2 = fileReader.ReadLine()
        MsgBox("The first line of the file is " & stringReader1)
        MsgBox("The second line of the file is " & stringReader2)
    End Sub
End Class



vbscript kullanarak gmail attachlı mail yolla

Aşağıdaki dosyayı önce gmail kullanıcı adını ve parolasını düzenle ve  d:\ye sm.vbs olarak kaydet ve en altta cmd satırını uygula
‘ VBScript to Send Email Notification
‘ Usage: cscript.exe sendemail.vbs email subject text
‘ 23/Dec/2014
Sub SendEmail(ToAddress, Subject, Text)
    Dim iMsg 
    Dim iConf
    Dim Flds
 
    Set iMsg = CreateObject(“CDO.Message”)
    Set iConf = CreateObject(“CDO.Configuration”)
 
    iConf.Load -1
    Set Flds = iConf.Fields
    
    With Flds
        .Item(“http://schemas.microsoft.com/cdo/configuration/sendusername&#8221;) = “fromgmail@gmail.com”
        .Item(“http://schemas.microsoft.com/cdo/configuration/sendpassword&#8221;) = “frompassword123”
        .Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver&#8221;) = “smtp.gmail.com” ‘smtp mail server
        .Update
    End With
 
    With iMsg
        Set .Configuration = iConf
        .To = ToAddress
        .From = “fromgmail@gmail.com”
        .Subject = Subject
        .TextBody = Text
.AddAttachment  “C:\backup.txt” 
        .Send
       
    End With
 
    Set iMsg = Nothing
    Set iConf = Nothing
End Sub
 
If WScript.Arguments.Count 3 Then
    WScript.Echo “Usage: cscript.exe ” & WScript.ScriptFullName & ” email subject text”
Else 
    SendEmail WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2)
End If
—————————–
komut satırında çalıştır aşağıdakini ve mail gider
cscript d:\sm.vbs togmail@gmail.com epostakonu epostaicerik