New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching language of VB.NET
:: Pass it a path and a number of days; it will delete ex*.log under that path older than that many days.
:: requires unix find.exe
:: ! -mtime -%DAYS% handles the edge case more to my liking than -mtime +%DAYS%.
SET LOGPATH=%1
IF "x%LOGPATH%"=="x" SET LOGPATH=d:\logfiles
SET DAYS=%2
IF "x%DAYS%"=="x" SET DAYS=7
for /f %%i in ('unixfind %LOGPATH% -name "ex*.log" -type f ! -mtime -%DAYS%') do del %%i
Wednesday @ 7:46pm
Tags:
5 Views
no comments
 
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Net
Imports System.IO
 
Public Class Form1
    <DllImport("wininet.dll", SetLastError:=True)> _
    Public Shared Function InternetGetCookie(ByVal url As String, ByVal cookieName As String, ByVal cookieData As StringBuilder, ByRef size As Integer) As Boolean
    End Function
by Enès   Sunday @ 5:12pm
Tags:
14 Views
no comments
 
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate(Application.StartupPath)
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim MyYoutube As New YTEngine
        MyYoutube.YT_StartProcessing(TextBox1.Text)
        PictureBox1.ImageLocation = MyYoutube.YT_Return_Video_Thumbnail
        PictureBox1.Tag = MyYoutube.YT_Return_Titled_Download_URL
        PictureBox1.Name = MyYoutube.YT_Return_Video_Title + ".flv"
August 28, 2010 @ 10:28pm
27 Views
no comments
 
Private Function isValidFolderName(ByVal dir As String, ByVal ver As String, ByRef problem As Exception) As Boolean
        Try
            Dim dirNotVersioned As New DirectoryInfo(dir)
            Dim dirVersioned = New DirectoryInfo(dir & "\" & ver)
            If dirNotVersioned.Exists() Then
                If Not dirVersioned.Exists Then
                    dirVersioned.Create()
                End If
            End If
            Return True
August 26, 2010 @ 8:52am
Tags:
13 Views
no comments
 
UseSQLiteDatabase()
 
Import ""
  PB_OpenDatabase2(id, name.s, user.s, Password.s, Plugin)
  PB_DatabaseQuery(id, sql.s)
  PB_DatabaseUpdate(id, sql.s)
  PB_CloseDatabase(id)
EndImport
 
Prototype OpenDatabase(id, name.s, user.s, Password.s, Plugin=0)
August 25, 2010 @ 1:06pm
Tags:
16 Views
no comments
 
Prototype OpenDatabase(id, name.s, user.s, Password.s, Plugin=0)
Prototype DatabaseQuery(id, sql.s)
Prototype DatabaseUpdate(id, sql.s)
Prototype CloseDatabase(id)
 
Structure iDataBase
  OpenDatabase.OpenDatabase
  DatabaseQuery.DatabaseQuery
  DatabaseUpdate.DatabaseUpdate
  CloseDatabase.CloseDatabase
August 25, 2010 @ 1:04pm
Tags:
18 Views
no comments
 
<% @ Language=VBScript %>
<!--#include file="admin_common.asp" -->
<!-- #include file="includes/admin_header_inc.asp" -->
<title>Özel Mesajların Tümü</title>
<table border="0" align="center" cellpadding="4" cellspacing="1" class="tableBorder">
    <tr>
      <td colspan="4" class="tableLedger">Özel Mesajları izle</td>
    </tr>
<%
'if not blnAdmin then Response.Redirect("Default.asp")
by Enès   August 19, 2010 @ 7:04pm
14 Views
no comments
 
<% @ Language=VBScript %>
<!--#include file="admin_common.asp" -->
<!-- #include file="includes/admin_header_inc.asp" -->
<title>Özel Mesajların Tümü</title>
<table border="0" align="center" cellpadding="4" cellspacing="1" class="tableBorder">
    <tr>
      <td colspan="4" class="tableLedger">Özel Mesajları izle</td>
    </tr>
<%
'if not blnAdmin then Response.Redirect("Default.asp")
by EPStyle   August 17, 2010 @ 10:51am
17 Views
no comments
 
Dim whereSet As Boolean = False
 
    Public Function cbVal(ByVal value As String) As String
        Dim vClass As String = "NotApplicable"
        Dim val As Integer = CInt(value)
        If val = 0 Then
            vClass = "False"
        ElseIf val = 1 Then
            vClass = "True"
        Else
by Justin   August 16, 2010 @ 1:37pm
Tags:
13 Views
no comments
 
Imports System.Windows
Imports System.Windows.Forms
 
Public Class Form1
    Dim rc As ResizeableControl
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        rc = New ResizeableControl(RichTextBox1)
        rc = New ResizeableControl(PictureBox1)
        AddHandler Me.Click, AddressOf Object_Click
by Mayank   August 11, 2010 @ 2:55pm
Tags:
21 Views
no comments
 
Public Class Form1
   Dim rc As ResizeableControl
 
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       rc = New ResizeableControl(RichTextBox1)
       rc = New ResizeableControl(Picturebox1)
   End Sub
   Public Class ResizeableControl
       Private WithEvents mControl As Control
       Private mMouseDown As Boolean = False
August 11, 2010 @ 1:54pm
Tags:
17 Views
no comments
 
' I watched Karl's video about validation with custom rules, and wondered
' why Silverlight, ASP.NET and ASP.NET MVC had DataAnnotations, and
' WPF only had IDataErrorInfo. So I thought of using EF4 as the model,
' and generating a metadata class like in RIA, MVC, etc for WPF and a
' inheritable generic class to convert the validations between IDataErrorInfo
' and the DataAnnotation attributes. 
'
' This way validation can happen the same way for each type of client!
'
' Let me know what you think please?
by rickrat   July 02, 2010 @ 3:54am
86 Views
no comments
 
Dim fc As New System.Drawing.Text.InstalledFontCollection
Fonts = (From x In Enumerable.Range(0, fc.Families.Count) _
         Select New With {.Id = x + 1, _
                          .Name = fc.Families(x).Name, _
                          .SortOrder = (x + 1) * 100}).ToList
fc = Nothing
by Thom Lamb   June 30, 2010 @ 10:54am
Tags: .Net, VB, Fonts, Linq
30 Views
no comments
 
 
Imports System.Net
Imports System.Net.NetworkInformation
Imports System.Threading
Imports System.Text
 
Public Class Form1
 
    Private Sub SimpleButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton1.Click
        MemoEdit1.Text = ""
by Thom Lamb   June 25, 2010 @ 10:13am
Tags: .Net, VB. Ping
32 Views
no comments
 
' Import ...
 
Public Module EnvironmentEvents
 
' Autogenerated code ...
 
    Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
        If (DTE.ToolWindows.ErrorList.ErrorItems.Count = 0) Then
            SelectRootNode()
            DTE.ExecuteCommand("TestDriven.NET.RunTests")
by Dennis Traub   June 17, 2010 @ 9:40pm
59 Views
no comments
 
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
by Eric Hexter   June 17, 2010 @ 1:41pm
Tags:
249 Views
no comments
 
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated from a template.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
 
Option Compare Binary
by rickrat   June 13, 2010 @ 4:51pm
63 Views
no comments
 
<System.ContextStaticAttribute()> Public WithEvents BuildEvents As EnvDTE.BuildEvents
 
Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
    Run_Tests()
End Sub
 
Private Sub Run_Tests()
    DTE.ExecuteCommand("Test.RunAllTestsInSolution")
    DTE.ExecuteCommand("Test.TestResults")
End Sub
June 04, 2010 @ 6:14am
Tags:
152 Views
no comments
 
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE100
Imports System.Diagnostics
Imports System.IO
Imports System.Threading
Imports System.ComponentModel
by Keith   May 31, 2010 @ 5:32pm
58 Views
no comments
 
Try
 
    Habanero.Base.GlobalRegistry.ApplicationName = "IGD"
    Habanero.Base.GlobalRegistry.ApplicationVersion = "v1.0"
    HabaneroApplication = New Habanero.UI.Win.HabaneroAppWin(Habanero.Base.GlobalRegistry.ApplicationName, Habanero.Base.GlobalRegistry.ApplicationVersion)
    HabaneroApplication.ClassDefsXml = IGD.BO.BOBroker.GetClassDefsXml()
 
    If Not HabaneroApplication.Startup() Then
        Throw New Exception("Unable to start Habanero Application")
    End If
by Mitchell William Cooper   May 30, 2010 @ 2:57pm
Tags: Habanero, ASP.NET,
43 Views
no comments
 
if(bOrgBudget) then
    if(CLng(getCourseCostExt(currentID,"")) > 0) then
        if(isCourseLocked(currentID,"")) then
            mainMessage = getMessage(MSG_COURSE_USER_ENROLLED)
           deleteCourse = 0
           Exit Function
        end if
    end if
end if
by Muhammad Zaheer Tariq   May 27, 2010 @ 5:01am
Tags:
46 Views
no comments
 
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Net.Sockets
Imports System.IO
Imports System.Threading
by cn   May 23, 2010 @ 10:48pm
Tags: rat
92 Views
no comments
 
<Extension()> _
Public Function GetBindingInfo(ByVal DataLayoutControl As DataLayoutControl, _
                               Optional ByVal ExcludePropetries As String = "") As List(Of DataLayoutBindingInfo)
    Dim bh As New LayoutElementsBindingInfoHelper(DataLayoutControl)
    Dim info As LayoutElementsBindingInfo = bh.CreateDataLayoutElementsBindingInfo
    GetBindingInfo = (From x As LayoutElementBindingInfo In info.GetAllBindings _
                      Where (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludeNames)) _
                      And (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludePropetries)) _
                      Select New DataLayoutBindingInfo(x.DataInfo.Name, x.DataInfo.Caption, x.Visible, x.EditorType)).ToList
End Function
by Thom Lamb   May 19, 2010 @ 7:42am
56 Views
no comments
 
Public Class frmMain
 
    Public Sub New()
        InitializeComponent()
    End Sub
 
    Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
        Try
            If MsgBox("Are you sure you want to exit?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit?") = MsgBoxResult.No Then
                e.Cancel = True
by Justin Davis   May 13, 2010 @ 1:13pm
Tags: test
38 Views
no comments
 
'Definition
Imports System.Runtime.ComplierServices
 
<Extension()>
Public Sub Add(ByVal BaseCriteria As CriteriaOperator, ByVal AdditionalCriteria As CriteriaOperator, Optional ByVal JoinType As GroupOperatorType = GroupOperatorType.And)
    If AdditionalCriteria IsNot Nothing Then
        If BaseCriteria Is Nothing Then
            BaseCriteria = AdditionalCriteria
        Else
            BaseCriteria = New GroupOperator(JoinType, BaseCriteria, AdditionalCriteria)
by AussieALF   May 05, 2010 @ 4:28pm
Tags:
93 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate