Format:
Recent snippets matching tags of VB.NET
Usage 'strContent = AES_Encrypt(strContent, "somepassword") 'File.WriteAllText("encrypted.txt", strContent) 'strContent = AES_Decrypt(strContent, "somepassword") 'File.WriteAllText("decrypted.txt", strContent) Public Function AES_Encrypt(ByVal input As String, ByVal pass As String) As String Dim AES As New System.Security.Cryptography.RijndaelManaged Dim Hash_AES As New System.Security.Cryptography.MD5CryptoServiceProvider
138 Views
no comments
Module Module1 Public Enum PivotAction Sum = 1 Min = 2 Max = 3 Count = 4 End Enum Public Function Pivot(ByVal SourceTable As DataTable, _ ByVal PrimaryKeyColumn As String, _ ByVal PivotNameColumn As String, _
138 Views
1 comments
''' <summary> ''' An Extension of the ControlCollection ''' </summary> ''' <param name="controls"></param> ''' <returns>An Enumerable collection of all of the controls in a ControlCollection</returns> ''' <remarks></remarks> <Extension()> _ Public Function All(ByVal controls As ControlCollection) As IEnumerable(Of Control) Dim results As New List(Of Control) For Each Control As Control In controls
153 Views
no comments
Partial MustInherit Class InformationSchema
Inherits System.Data.Linq.DataContext
Private Shared mappingSource As System.Data.Linq.Mapping.MappingSource = New AttributeMappingSource
#Region " Constructors "
Public Sub New(ByVal connection As String)
MyBase.New(connection, mappingSource)
End Sub
238 Views
no comments
Imports System.Collections.Generic Imports System.Data Imports System.Data.Linq Imports System.Data.Linq.Mapping Imports System.IO Imports System.Linq Imports System.Text Imports System.Diagnostics Imports System.Reflection
411 Views
no comments
#Region " Import Declaratives " Imports System.ComponentModel Imports System.Data.Linq Imports System.Data.Linq.Mapping Imports System.Reflection #End Region
303 Views
no comments
Module Module1 Sub Main() Dim InputXml = <?xml version="1.0" encoding="utf-8"?> <users> <user id="1" name="Eduardo"/> <user id="2" name="Luciano"/> <user id="3" name="Ricardo"/> </users>
376 Views
no comments
Imports System.Text.RegularExpressions Module Module1 'http://learn.open.ac.uk/mod/oublog/viewpost.php?post=23031 'www.ForkandBeard.co.uk Sub Main() Dim strUserNumbers As String() strUserNumbers = New String() { _
441 Views
no comments
Imports System.Text.RegularExpressions Module Module1 Sub Main() Dim strUserNumbers As String() strUserNumbers = New String() { _ "H0W_BOvThemy84kies" _ , "01543 MWC66" _ , "8" _
307 Views
no comments
Imports System Imports System.Linq Imports System.Net.Mail Imports System.Web.Mvc Imports System.Web.Security Imports MvcMembership <Authorize(Roles:="Administrador")> _
1154 Views
no comments
<Extension()> _ Function ToEnum(Of T)(ByVal str As String) As T Return DirectCast([Enum].Parse(GetType(T), str), T) End Function
263 Views
no comments
Dim Message As String = String.Empty Dim TargetUserName = String.Empty 'but could be "seller1" or "seller2" Dim credentials As UserIdPasswordType = New UserIdPasswordType credentials.Username = "master1" credentials.Password = "master1password" credentials.Signature = "master1signature" If Not String.IsNullOrEmpty(TargetUserName) Then credentials.Subject = TargetUserName Dim customSecurityHeader As CustomSecurityHeaderType = New CustomSecurityHeaderType
395 Views
no comments
Public Class DieCollection Inherits System.Collections.ObjectModel.Collection(Of Die) Public Function RollAll() As Integer() Dim values(Me.Count - 1) As Integer For index As Integer = 0 To values.GetUpperBound(0) values(index) = Me.Items(index).Roll() Next Return values End Function
354 Views
no comments
''' <summary> ''' Rotina para forçar o download de arquivos ''' </summary> ''' <param name="caminhoArquivo">Caminho para o arquivo no sistema de arquivos</param> ''' <param name="contentType">Content-Type do arquivo (opcional)</param> Protected Sub ForceDownload(ByVal caminhoArquivo As String, _ Optional ByVal contentType As String = "application/octet-stream") Dim arquivo As FileInfo = New FileInfo(caminhoArquivo) Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" + arquivo.Name)
432 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
