theDeSilva.com Andrew de Silva

Entries Tagged as '.NET'

Using cmd.exe with VB.NET – Process.Start

January 27th, 2010 · No Comments · .NET

Here’s a quick function to show the use of System.Diagnostic.Process which will allow you to start another application using VB.NET. The example below is used to call svnadmin to create a new repository ( Subversion ) by grabbing the repository name. The function also checks to see whether the directory exist on the file system [...]

[Read more →]

Tags:····

VB.NET Database query return result as XML

January 25th, 2010 · No Comments · .NET

A simple VB.NET page that takes a ID variable and return the result as XML page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
Imports System.IO
Imports System.Xml
Imports System.Data
Imports System.Data.SqlClient
 
Partial Class writeXML
Inherits System.Web.UI.Page
 
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
GetXML(Request.QueryString("pid"))
End Sub
 
[...]

[Read more →]

Tags:···

Resize image using VB.NET

January 21st, 2010 · No Comments · .NET

Here’s a quick function to resize image using VB.NET

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Sub ResizeImage(ByVal dir As String, ByVal fileName As String, ByVal percentResize As Double)
‘following code resizes picture to fit
 
Dim bm As New Bitmap("C:\" & dir & "\" & fileName)
 
[...]

[Read more →]

Tags:····

Save File Stream using VB.NET

January 4th, 2010 · No Comments · .NET

Here is a simple VB.NET that would allow you to post a file stream from Flex. The class below saves the file into a location on your server. To use it you can simply use HTTP POST and pass in the directory save location using the query string dir. I used a catch try [...]

[Read more →]

Tags:

Write Error Log using VB.NET

August 12th, 2009 · No Comments · .NET

There are times when you will need to write something to the screen to debug your VB.NET code and find it impossible as there are certain things that doesn’t really display a page. A web service don’t normally show a web page after it’s been called and it’s such a pain to debug errors if [...]

[Read more →]

Tags:·····