This sample class for Encrypt/Descrypt string : Imports System.IO Imports System.Security.Cryptography Imports System.Text Public Class globalSecurity Protected key As String = “&/?@*>:>” Public Sub New() ‘constructor End Sub Public Function encryptString(ByVal strtext As String) As String Return Encrypt(strtext, key) End Function Public Function decryptString(ByVal strtext As String) As String Return Decrypt(strtext, key) End Function ‘The … Continue reading
Before discuss FTP client upload source code, the first must be understanding type of FTP Server mode, first is Active mode and Passive mode for second. Passive mode In passive mode, the client has no control over what port the server chooses for the data connection. Therefore, in order to use passive mode, you’ll have … Continue reading
Stack error assign value to SSIS paramter via ASP.NET or batch file. Yesterday I’m stack in Execute Process Task to execute Batch file, that batch is setting of SSIS execute. The First solution, 1. restart your IIS (if using ASP.NET) always restart your IIS after changed the SSIS component and properties value 2. Change variable properties … Continue reading
XML File: ‘<?xml version = “1.0”?> ‘<books xmlns = “x-schema:book.xdr”> ‘ <book> ‘ <title>C# How to Program</title> ‘ </book> ‘ <book> ‘ <title>Java How to Program, 4/e</title> ‘ </book> ‘ <book> ‘ <title>Visual Basic .NET How to Program</title> ‘ </book> ‘ <book> ‘ <title>Advanced Java 2 Platform How to Program</title> ‘ </book> ‘ <book> ‘ <title>Python How to Program</title> ‘ </book> ‘</books> VB.NET Script : Imports System Imports System.Drawing Imports System.Data Imports System.IO Imports System.Collections Imports System.Windows.Forms Imports System.Xml Public Class MainClass Shared Sub Main() Dim filename As String = “book.xml” Dim reader As New XmlTextReader(filename) reader.MoveToContent() Dim addressData As Collection, elementName As String Do While reader.Read Select Case reader.NodeType Case XmlNodeType.Element Console.WriteLine(“XmlNodeType.Element ” & reader.Name ) Case XmlNodeType.Text Console.WriteLine(“XmlNodeType.Text ” & reader.Value ) Case XmlNodeType.EndElement Console.WriteLine(“XmlNodeType.EndElement ” & reader.Name ) End Select Loop End Sub End Class See Also :http://www.java2s.com/Code/VB/XML/XmlTextReaderXmlNodeTypeElementTextandEndElement.htm http://www.dotnetperls.com/xmlreader-vbnet
Before set connectionString in web.config </configuration> <appSettings> <add key=”ConnectionString” value=”server=localhost;uid=sa;pwd=sa;database=DBNAME” /> </appSettings> </configuration> 1. Fill DropDownList Dim ds As DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings(“ConnectionString”), “sp_name”, “FieldName = 1”) ddl.DataSource = ds ddl.DataBind() ddl.Items.Insert(0, “-please select one-“) Fungsi dari ddlGolongan_Pemilik.Items.Insert(0, “”) untuk memberikan nilai default. 2. Bind DataGrid DataGrid4.DataSource = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings(“ConnectionString”) , CommandType.Text, strSql); DataGrid4.DataBind();
Introduction In an earlier article of mine, An Introduction and Overview of the Microsoft Application Blocks, we outlined the purpose and benefits of Microsoft Application Blocks. Application Blocks encapsulate two common patterns encountered in application programming, data access and exception management. Application Blocks provide value by making our programming more efficient and our programs more maintainable. … Continue reading
Title TestDetailsPattern Title Expression ^\$[0-9]+(\.[0-9][0-9])?$ Description Validates a dollar amount including a dollar sign and 2 decmals. The decimal and cents are optional. Matches $1.50 | $49 | $0.50 Non-Matches 1.5 | $1.333 | this $5.12 fails Title TestDetailsPattern Title Expression ^(\d{1,3}'(\d{3}’)*\d{3}(\.\d{1,3})?|\d{1,3}(\.\d{3})?)$ Description This regex match numeric data in the following format: thousands are separated by (‘) apostrophe, decimal places are separated by … Continue reading
Add a NotifyIcon to your form by double-clicking on it in the Toolbox Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Resize ‘ If minimize form that will show in system tray. If System.Windows.Forms.FormWindowState.Minimized = WindowState Then sysMonTray.ShowBalloonTip(5, “Running”, “Running Your Program”, ToolTipIcon.Info) Me.Hide() End If End Sub Private Sub sysMonTray_Click(ByVal … Continue reading
Windows services, formerly known as NT services enable you to create long-running executable applications that run in its own Windows session, which then has the ability to start automatically when the computer boots and also can be manually paused, stopped or even restarted. Window Services do not have any interface to the user. Before Microsoft.Net … Continue reading
Are you understand for Raw print…? hmm this is print to paper in ancient age… If you have COM printer like in parking system or general ledger printing, may be this will helping you. Before i see this code, the printer (COM) only write but didn’t have ink on paper. After using this code that … Continue reading