İçeriğe geç
ShiftDelete.Net
Haber ara/ SDN'ye SorGiriş
Haber Akışı SDNTV İnceleme Forum Yapay Zeka Akıllı Telefon Elektrikli Otomobil Oyun ShiftDelete.Net Global Teknoloji Haberleri Mobil Otomobil Donanım Savunma Bilim Sosyal Medya İnternet Giyilebilir Teknoloji Rehber Ürünler Son dakika Yazarlar
  1. Ana sayfa
  2. Topluluk
  3. Programlama
  4. Programlama Dilleri
Programlama Dilleri

Hazır Kodlar.

spyscorpio09.09.20114 cevap5.005 görüntüleme
2011'den beri104 mesaj
#1
Sabitlenmesi mükemmel olur =)

Visual Basic:

Programın kapanmasını engellemek(Form1'in altına)
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = cp.ClassStyle Or CS_NOCLOSE
CS_NOCLOSE.ToString.Trim()
Return cp
End Get
End Property

Kendini Kopyalama:

Dim Path As String = "C:\"
System.IO.File.Copy(Application.ExecutablePath, Path + System.IO.Path.GetFileName(Application.ExecutablePath))

Varsayılan tarayıcıdan site açmak.
Shell("explorer.exe http://www.siteadı.com/")

Kendini silme:
Dim kod As String
kod = My.Application.Info.DirectoryPath
Kill(kod & "\sil.exe")

FormBorderStyle None iken Form'u hareket ettirebilme:(Form1'in Altına)
Dim IsDraggingForm As Boolean = False
    Private MousePos As New System.Drawing.Point(0, 0)

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
        If e.Button = MouseButtons.Left Then
            IsDraggingForm = True
            MousePos = e.Location
        End If
    End Sub

    Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp
        If e.Button = MouseButtons.Left Then IsDraggingForm = False
     End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove
        If IsDraggingForm Then
            Dim temp As Point = New Point(Me.Location + (e.Location - MousePos))
            Me.Location = temp
            temp = Nothing
        End If
    End Sub

C#
Internet sitesi açtırma:
system.diagnostics.process.start("explorer.exe", "http://www.siteadı.com")
Cevaplar
2009'den beri452 mesaj
#2
Yeni başlayanlar için yararlı bir paylaşım.Umarım konu sabitlenir.
spyscorpio Konuyu açan
2011'den beri104 mesaj
#3
VB:
Klavye Kısayolu Oluşturma:(Keydown Olayına)
If e.control = True Then 
     If (e.Keycode=Keys.F ) Then 
     Yapmak istedigin kodları yazıyosun 
     End If 
End If

Programın sadece birden fazla açılmasını engellemek:
 Public Sub ProgramKontrol()
        On Error Resume Next
        Dim CalisanProg() As Process

        Dim ModAdi, ProgAdi As String
        ModAdi = Process.GetCurrentProcess.MainModule.ModuleName
        ProgAdi = System.IO.Path.GetFileNameWithoutExtension(ModAdi)

        CalisanProg = Process.GetProcessesByName(ProgAdi)

        If CalisanProg.Length > 1 Then
            MessageBox.Show("Program sadece 1 kere açılabilir.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            'Yeni açılan programı kapatıyoruz.
            End
        End If
    End Sub

Dosya İşlemleri:

Dosya Taşıma:
My.Computer.FileSystem.MoveFile("C:\eski_yer\dosya.txt", "C:\yeni_yer\yeni isim.txt")

Klasör Kopyalama:
My.Computer.FileSystem.CopyDirectory("C:\kaynak_klasor", "D:\Hedef_klasor")

Dosya Okutma:
My.Computer.FileSystem.WriteAllText("C:\Test.txt", String.Empty, False)

Klasör Oluşturma:
My.Computer.FileSystem.CreateDirectory("C:\Yeni_klasor")

Dosya Kopyalama:
My.Computer.FileSystem.CopyFile("C:\kaynak.txt", "C:\yeni_klasor\hedef.txt")

Klasör Koplayama:
My.Computer.FileSystem.CopyDirectory("C:\kaynak_klasor", "D:\yeni_klasor")

Dosya Silme:
My.Computer.FileSystem.DeleteFile("C:\Test.txt", FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)

Klasör Silme:
My.Computer.FileSystem.DeleteDirectory("C:\Test.txt", FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)

Dosyadan Metin Okuma:
Dim dicerigi As String = My.Computer.FileSystem.ReadAllText("C:\Test.txt")

Dosyanın Adını Değiştirme:
My.Computer.FileSystem.RenameFile("C:\eski.txt", "yeni.txt")

Klasörün Adını Değiştirme:
My.Computer.FileSystem.RenameDirectory("C:\eski_klasor", "yeni_klasor")


spyscorpio Konuyu açan
2011'den beri104 mesaj
#4
devam etcem yakında beyler. şimdi pcyi sattım orda kaldı bilgiler :(
2011'den beri11 mesaj
#5
Yararlı olabilir, teşekkürler.

Cevabını yaz

Cevap yazmak için giriş yap ya da üye ol. Eski forum kullanıcı adın ve parolanla girebilirsin.