Blog Of Sem: March 2016

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

1Dim finfo As New IO.DirectoryInfo("C:\Story")
2For Each fi In finfo.GetFiles
3  Listbox1.Items.Add(fi.FullName)
4Next



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

Next

pinterest follow all from google console


for(var bas=0; bas<1000;bas++){
function pinterestlikenext(){
javascript:var inputlike = document.getElementsByClassName('_ebwb5 _1tv0k _345gm coreSpriteHeartOpen');
javascript:var inputfollow = document.getElementsByClassName('_jvpff _k2yal _csba8 _i46jh _nv5lf');
javascript:var inputnext = document.getElementsByClassName('_de018 coreSpriteRightPaginationArrow');
for(var i=0; i<inputslike.length;i++){
inputlike[i].click();
inputfollow[i].click();
inputnext[i].click();}
}

setTimeout(pinterestlikenext,9000)
}



javascript:var inputlike = document.getElementsByClassName(' Button FollowButton Module UserFollowButton btn hasText notNavigatable primary rounded');
for(var i=0; i<inputlike.length;i++){
inputlike[i].click();}

[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

VB Facebook bot beta

Public Class Form1
    Private x, y, z As Integer
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim fileReader As System.IO.StreamReader
        fileReader =
        My.Computer.FileSystem.OpenTextFileReader("info.txt")
        Dim stringReader1, stringReader2, stringReader3 As String

        stringReader1 = fileReader.ReadLine()
        stringReader2 = fileReader.ReadLine()
        stringReader3 = fileReader.ReadLine()
        WebBrowser1.Navigate(stringReader1)
        TextBox1.Text = stringReader2
        TextBox2.Text = stringReader3

        Me.Enabled = False
        WebBrowser1.Visible = False
        Timer2.Enabled = True

    End Sub

    Private Sub navigateGrup()

        WebBrowser1.Refresh()

        Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
        ListBox1.Items.Clear()
        For Each Element As HtmlElement In Page
            If Element.GetAttribute("href").Contains("/groups") Then
                If Element.GetAttribute("href").Contains("/groups/create") Then GoTo asd
                If Element.GetAttribute("href").Contains("/groups/?") Then GoTo asd
                ListBox1.Items.Add(Element.GetAttribute("href").ToString())
asd:
            End If
        Next

        Timer1.Interval = 3000
        Timer1.Enabled = True
        Timer1.Start()

    End Sub
    Private Sub navigateLogout()
        WebBrowser1.Refresh()

        Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
        ListBox1.Items.Clear()
        For Each Element As HtmlElement In Page
            If Element.GetAttribute("href").Contains("/logout") Then
                WebBrowser1.Navigate(Element.GetAttribute("href").ToString())
            End If
        Next

    End Sub

    Private Sub navigateBegen()

        WebBrowser1.Refresh()

        Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
        ListBox2.Items.Clear()
        For Each Element As HtmlElement In Page
            If Element.GetAttribute("href").Contains("/like.php?") Then

                ListBox2.Items.Add(Element.GetAttribute("href").ToString())

            End If
        Next

        Timer3.Interval = 3000
        Timer3.Enabled = True
        Timer3.Start()

    End Sub

    Private Sub navigateMsjYaz()

        WebBrowser1.Refresh()

        Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
        ListBox3.Items.Clear()
        For Each Element As HtmlElement In Page
            If Element.GetAttribute("href").Contains("compose/?ids=") Then

                ListBox3.Items.Add(Element.GetAttribute("href").ToString())

            End If
        Next
        Timer4.Interval = 3000
        Timer4.Enabled = True
        Timer4.Start()

 

    End Sub



    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("email").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("pass").SetAttribute("value", TextBox2.Text)
        WebBrowser1.Document.GetElementById("login").InvokeMember("click")
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim durum As HtmlElement = WebBrowser1.Document.GetElementById("xc_message")
        durum.SetAttribute("value", "deneme duvar yazısı")
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        navigateGrup()
    End Sub


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

        x = x + 1
        If x > ListBox1.Items.Count Then
            Timer1.Stop()
        Else
            ListBox1.SelectedIndex = x - 1
            WebBrowser1.Navigate(ListBox1.Items(x - 1).ToString)
        End If

    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        navigateLogout()
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
        navigateLogout()
        Me.Enabled = True
        WebBrowser1.Visible = True
        Timer2.Enabled = False
    End Sub

    Private Sub MemoEdit1_EditValueChanged(sender As Object, e As EventArgs)

    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        navigateBegen()
    End Sub

    Private Sub ListBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox2.SelectedIndexChanged

    End Sub

    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick

        y = y + 1
        If y > ListBox2.Items.Count Then
            Timer3.Stop()
        Else
            ListBox2.SelectedIndex = y - 1
            WebBrowser1.Navigate(ListBox2.Items(y - 1).ToString)
        End If
    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        navigateMsjYaz()
    End Sub

    Private Sub Timer4_Tick(sender As Object, e As EventArgs) Handles Timer4.Tick

        z = z + 1
        If z > ListBox3.Items.Count Then
            Timer4.Stop()
        Else
            ListBox3.SelectedIndex = z - 1
            WebBrowser1.Navigate(ListBox3.Items(z - 1).ToString)



        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

Küçük işletmeler için yedekleme stratejisi

Eğer işletme ms sql kullanıyorsa yedekleme için:  yedekscript.sql diye bir dosya yarat(sqlyedek.sql) ve içine
Kullanılan araçlar:
windows task manager
notepad
özeillkler:
mssql yedek alma
mail yollama
günlük yedek alma

--------------------------------------------------------------------------
MSSQL KOMUT SATIRINDA YEDEKLEMEK İÇİN
BACKUP DATABASE [VT_2008] TO  DISK = N'f:\zbasic\yedek\1\VT_2008.bak' WITH NOFORMAT, NOINIT,  NAME = N'VT_2008-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO


kaydettikten sonra batch dosyası yarat ve içine
sqlcmd -S \SQLEXPRESS -i "f:\zbasic\yedek\sqlyedek.sql"
---------------------------------------------------------------------------------


KOMUT SATIRINDAN MAIL YOLLAMAK İÇİN ONCE SM.VBS dosyası yarat gmail
' VBScript to Send Email Notification
' Author: https://helloacm.com
' 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/smtpusessl") = True
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sender@gmail.com"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "senderpass"
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" 'smtp mail server
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 'stmp server
        .Update
    End With
 
    With iMsg
        Set .Configuration = iConf
        .To = ToAddress
        .From = "sender@gmail.com"
        .Subject = Subject
        .TextBody = Text
.AddAttachment  "C:\yedek.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


kaydettikten sonra batch dosyası yarat ve 
cscript f:\zbasic\yedek\sm.vbs receiver@gmail.com YDK YDK
-----------------------------------------------------------------------------------------

KOMUT SATIRINDAN WINRARLA SIKIŞTIRMA PARÇALI OLARAK
"c:\program files\winrar\rar.exe" a -r -v15000k "C:\Program Files\Internet Explorer\yedek" "C:\Program Files\Internet Explorer\yedek.exe"

PARÇASIZ OLARAK
"c:\program files\winrar\rar.exe" a -r "C:\Program Files\Internet Explorer\yedek" "C:\Program Files\Internet Explorer\yedek.exe"

android studio get shared preferences

Yazmak için
if(jsonResult == 1){
    Intent intent = new Intent(MainActivity.this, LoginActivity.class);    intent.putExtra("USERNAME", enteredUsername);    intent.putExtra("MESSAGE", "You have been successfully login");
    SharedPreferences userDetails = getApplicationContext().getSharedPreferences("kullanicibilgisi", MODE_PRIVATE);    SharedPreferences.Editor edit = userDetails.edit();    edit.clear();    edit.putString("kullaniciadi", username.getText().toString());    edit.putString("parola", password.getText().toString());    edit.commit();




okumak için
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_main);
    SharedPreferences userDetails = getSharedPreferences("kullanicibilgisi", MODE_PRIVATE);    String test1 = userDetails.getString("kullaniciadi", "");    String test2 = userDetails.getString("parola", "");    Toast.makeText(getApplicationContext(), test1, Toast.LENGTH_LONG).show();    Toast.makeText(getApplicationContext(), test2, Toast.LENGTH_LONG).show();