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
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
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"
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
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)
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
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")
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")
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
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
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
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?
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
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 = ""
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")
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
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
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
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
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
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
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
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
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
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)
93 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
