Click here to Skip to main content
13,801,281 members
Click here to Skip to main content

Stats

12.6K views
702 downloads
12 bookmarked
Posted 15 Apr 2012
Licenced CPOL

VB.NET wrappers for much of the Windows API

, 15 Apr 2012
Includes most API functions except for graphics.
UtilitiesLib
bin
Debug
sclib.dll
sclib.pdb
Release
sclib.dll
sclib.pdb
My Project
Application.myapp
vssver2.scc
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
Salience.Library.Resources.resources
sclib.dll
sclib.pdb
TempPE
My Project.Resources.Designer.vb.dll
UtilitiesLib.vbproj.GenerateResource.Cache
Release
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource-ResGen.read.1.tlog
GenerateResource-ResGen.write.1.tlog
Salience.Library.Resources.resources
sclib.dll
sclib.pdb
TempPE
My Project.Resources.Designer.vb.dll
UtilitiesLib.suo
Imports System.IO
Imports System.Reflection

Public Class Resource

    Public Shared Function AsString(ByVal resourceName As String) As String
        Dim br As StreamReader = Nothing
        Try
            Dim assem As Assembly = Assembly.GetEntryAssembly()
            Dim source As Stream = assem.GetManifestResourceStream(resourceName)
            br = New StreamReader(source)
            Return br.ReadToEnd()
        Finally
            If br IsNot Nothing Then br.Close()
        End Try
    End Function

    Public Shared Sub StringToFile(ByVal str As String, ByVal filename As String)
        Dim bw As StreamWriter = Nothing
        Try
            bw = New StreamWriter(filename, False)
            bw.Write(str)
            bw.Flush()
        Finally
            If bw IsNot Nothing Then bw.Close()
        End Try
    End Sub

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

andrewbb@gmail.com
Architect
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.181215.1 | Last Updated 15 Apr 2012
Article Copyright 2012 by andrewbb@gmail.com
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid