vb.net

Is it possible to read from a url into a System.IO.Stream object?

I am attempting to read from a url into a System.IO.Stream object. I tried to use Dim stream as Stream = New FileStream(msgURL, FileMode.Open) but I get an error that URI formats are not supported with FileStream objects. Is there some method I can use that inherits from System.IO.Stream that is able to read from a URL? ...

VB.net: How to get data from Excel worksheet to string object?

I've tried this: 'start Excel app Dim exApp As Microsoft.Office.Interop.Excel.Application exApp = CreateObject("Excel.Application") ' load excel document exApp.Workbooks.Open(fname) Dim exSheet As Microsoft.Office.Interop.Excel.Worksheet exSheet = exApp.Workbooks(1).Worksheets(1) and than, for example a...

How can we use the colormatrix only a part of image rather than whole image?

I know the use of colormatrix. but this work on the whole image. is there any way to work with colormatrix only a part of image rather than whole image. eg i want to give the brightness of only border area of image. i am working with c#. ...

Is C# code faster than Visual Basic.NET code?

Is C# code faster than Visual Basic.NET code, or that is a myth? ...

Best way to combine Play and Pause button?

Hi, this is more of an advise thread I guess. I've been wondering how one could create a button which display "play" when it's not pressed. And then shows "pause" once it's pressed. And visa versa when it's pressed again. I had a similar problem when trying to create an expand panel button, but that was easy because I could just set a ...

Sending Documents to a Network Printer using .NET

We have large IBM Infoprint printers. I need to read a bunch of PDF files off a database, merge them together, and send it to one of these printers. I need to be able to specify many options such as what tray to use, with/without staple, etc. All of these options can be manually set when I try to print something off my computer (via t...

TypeInitializationException was unhandled - Trying to set a boolean variable

Hi, this is very strange. All of a sudden, I get this error message from Visual Studio saying that TypeInitializationException was unhandled. Searching for this error reveals that I should check if a variable is null(nothing) or not. My scenario is like this. I have a separate GlobalVariables.vb module which I create variables in. I do...

Host vs DnsSafeHost

I need to get the host out of the Request object. Which property should I use and why? From MSDN: Uri.DnsSafeHost Property A String that contains the unescaped host part of the URI that is suitable for DNS resolution; or the original unescaped host string, if it is already suitable for resolution. vs Uri.Host Prop...

VB.NET WinForms ListView Question

Hey. I have a ListView with 3 columns, how do I add specified text to the specified column I want? I've looked at the ..Add function, but it doesn't take the column index.. Thanks! ...

Is there such a thing as a nullable bool in vb.net

I am working through my new MVC book and of course, the samples are all in c# as usual. There is a line of code that says public bool? WillAttend { get; set; } The author explains that the question mark indicates that this is a nullable (tri-state) bool that can be true, false. or null. (A new C# 3 convention.) Does vb.net support ...

How to render the following asp.net mvc c# code snippet as vb.net code

Hello, Working through Pro ASP.NET MVC book and I got the following code snippet that appears in an aspx (view) page... <%= Html.DropDownList ("WillAttend",new[] { new SelectListItem { Text = "Yes, I'll be there",Value=bool.TrueString}, new SelectListItem { Text = "No, I can't come",Value=bool.FalseString} },"Choose an option"); %> ...

Delete Itself program

Hi, I need to write a program which deletes itself while running...How to do in vb.net and what is the concept to do it.. ...

Calculate the start and end date of a week given the week number and year in C# (based on the ISO specification)

I need to generate a report that shows the 52 weeks of a year (or 53 weeks as some years have) and their start and end dates. There is an ISO spec to do this but seems awfully complicated! Im hoping someone knows of a way to do it in C# or Visual Basic (its actually for Visual Basic 6 but I will try port it across) ...

How to terminate any type of files from win32process using vb.net

How to terminate any type of files from win32process using vb.net ...

LINQ to XML: how do I get only direct descendants of an XElement?

Dim xml = <Root> <Parent id="1"> <Child>Thomas</Child> </Parent> <Parent id="2"> <Child>Tim</Child> <Child>Jamie</Child> </Parent> </Root> Dim parents = xml.Elements In this case, children includes all the Parent elements and all of the...

Custom Installer Class

Hi everyone, I'm working on a project which needs some third party components prequisites to be installed before installing my .NET Application. Can someone tell me how to do it ?? I'm using .NET prequisites components to install the components like (.NET Framework 3.5,Windows installer 3.1,Crystal Reports) but what if i have some third...

ASP.NET Page inheritance

Hi Looking for advice on the net but not getting very far, so I thought I would ask for some advice. I've seen it done, so know what I want to do, but looking I can work out how it was done What I want to do, is allow users to modify the layout of an ASPX file, so that they can use it as a letter template, moving address lines, format ...

How can I group multiple e-mail addresses and user names using a regular expression

I have the following text that I am trying to parse: "[email protected]" <[email protected]>, "Jane Doe" <jane.doe@ addyB.org>, "[email protected]" <[email protected]> I am using the following code to try and split up the string: Dim groups As GroupCollection Dim matches As MatchCollection Dim regexp1 As New Regex("""(.*)"" <(.*)>...

Rounding a number down in VB

Hi I have a vb application that need to round a number down e.g. 2.556 would become 2.55 and not 2.26 I can do this using a function to strip off the characters more that 2 right from the decimal point using this: Dim TheString As String TheString = 2.556 Dim thelength = Len(TheString) Dim thedecimal = InStr(TheString, ".", CompareM...

How to create a cross-platform DLL in .net

I have a interesting problem: Where I work we've built a home-grown ERP system in VB6 that we are slowly moving over into vb.net. There are some projects have are in .net: we have a hand-held C# project that uses a web service to talk to our database, I've built some reporting screens using Crystal and some smaller maintenance screens. ...