vb.net

Where Can I Find FileUpload Class for Windows Application?

I have this snippet: protected void ProcessUpload(FileUpload upload) { if (upload.HasFile) { string fileName = Path.Combine(Server.MapPath("~/Uploads"), upload.FileName); if (File.Exists(fileName)) File.Delete(fileName); upload.S...

Trouble with vb.net declarations

I am new to vb.net (framework 4) and visual studio is giving me warnings on the following declarations. Private Declare Auto Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long Private Declare Auto Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal ...

how in .net i handle a click over a balloon tip, displayed through ShowBalloonTip of a TrayIcon

I use ShowBalloonTip method of a TrayIcon class to display a balloon tip. Is there a way to handle a click over this balloon? When i click over the balloon no event seem to be generated, and it only closes the balloon. ...

Long time running applications

I'm going to design an Application (C# or VB.NET) which use .NET Framework to run for very long time. It may be restarted every year or even more... Is there anything (using special design patterns or so) which I must care about in designing "Long time running applications in .NET"? Is .NET ever a good platform for these kind of applic...

Event handler not removing itself?

At the beginning of a VB .NET function I remove an event handler and add it again at the end of the function because the function's code would trigger those events and I do not want them to trigger for the duration of the function. This usually works, but I have run into a few situations where the event still gets called even though I h...

Is there a definite way to determine the overflow of a pen object when drawing a rotated object? .Net GDI+

As an example imagine you have a rectangular clock. The hand is made of a filled triangle with a border. The border is drawn with a gdi+ pen and the thickness can vary from 1 upwards. The problem is, the hand should always be within the bounds of the clock face. Using pen Alignment.Inset solves this problem but, because it renders terrib...

VB.NET - Genetic Algotithm - Knapsack Problem

I have been working on the Knapsack problem using genetic algorithms. But I have run into a few difficulties... First off the user generates a data set which is stored in a text document. From there I read the data in to the program. I do fine getting the program to calculate fitness values, select parents, produce children, then muta...

Visual Studio - automatically add necessary spaces to comments

When I'm writing comments in my code, I often forget to add the initial space after the comment identifier. 'this is a comment when really it is supposed to be ' this is a comment I realize this is quite trivial, and you could simply say "just add the damn space you idiot", but I'd really like to automate this so that I just ...

Randomize numbers in VB.NET without using a range i.e. Min and Max

Hi, I was wondering if anyone can point me in the right direction please? Say I am pulling the following table, I would then like to select an ID randomly. I understand how to select a random number using a Randomize() call followed by the relevant syntax but I want to pre-define the range. i.e. Table Data ID | Name 4345 ...

ASP.NET Webmethod always Returns 401..

Getting sick with asp.net permission madness... This time, I Just cant AJAX-CALL any kind of webmethod or i just get: {"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"} Code: <WebMethod(True)> _ Public Function Login(ByVal usuario As String, ByVal senha As String) As Boolean ...

Index was outside the bounds of the array

I am getting "Index was outside the bounds of the array." error when using this code: Dim RandomA As String = "aAÀàÁâÄäÅåĀāĂ㥹ǞǟǺǻÃãÄ" TextBox1.Text = TextBox1.Text.Replace("a", RandomA((Int(Rnd() * RandomA.Count)) - 1)) I fail to see how the (random) index can be out of bounds? ...

receive JSON array as argument in web service

I'm using a web service programmed in Visual Basic .NET 3.5 to receive a JSON Array sent from other application. I'm sending a JSON string like this one: [{"idRecoleccion":1,"PIN":"553648138"},{"idRecoleccion":2,"PIN":"553648138"}] And I'm receiving the code in Visual Basic .NET as follows: <WebMethod()> _ Public Function ConfirmaR...

.NET API for music programming?

In short words I am looking for a .NET translation of JFugue. Update I realize that there is no real .NET alternative for JFugue, the posts bellow are always great as a guideline for one who wants to develop it by his own. Thanks for all of you. Note: I want to emphsize that my search is on the transcription part, not the playing part,...

How to disable postback on click of a button in the Gridview?

i am working on vb.net. When i click a button in one of the row in the gridview, i am called a function to delete the data of tha row. it is working but it is getting postback. i have placed gridview inside asp updatepanel. How to prevent postback. ...

Pass windows credentials to Exchange 2007 web service VB.NET

I am trying to interop to Exchange 2007 via its web-services and have the following issue; Authentication mode = “windows” in the web.config…. Why isn’t the default credential passing the current user to the exchange webservice (EWS)? Dim esb As New mailserver.ExchangeServiceBinding() 'Provide the NetworkCredential esb....

How can I detect if my .NET assembly is running from web site or from a desktop machine?

I just want to write code inside my assembly to detect whether it is running on a "desktop machine", or inside the context of an ASP.NET application. This is crucial guys, (licensing purposes), and I don't want to get fired because I did a mistake. So, please, be direct and if you please give me some code snippet. EDIT: I depend on you...

How to record a specific applications audio? vb.net

How can I make an application that can record the audio output of another application using VB.net? ...

Could not load file or assembly

This is my Errormessage: Could not load file or assembly 'file:///C:\Windows\system32\Rule.dll'. The system cannot find the file specified. The problem is that the same exe works in my development environment but not on productive server. The program is a tool that should run as a Scheduled Task on Windows Server 2008. It consists of an...

How do I start phone-to-phone call with webcalldirect(betamax) in vb.net in my program?

Hello. I need to implement the phone-to-phone funcionality in vb.net. I've got the sip-account information from webcalldirect, but have no clue how to initiate a phone-to-phone call? In their clientapp their is such a function, so i thought it must be possible to do the same in my own clientapp. Thanks in advance ...

Custom NUnit test runner config location

I wrote my own NUnit test runner in VB .Net based on some of the following links: Implement your own NUnit TestRunner - Part 1 Stack Overflow - How to run NUnit programmatically Stack Overflow - Running NUnit Tests In a C# Console App My code is a custom MSBuild task running in a Web Application. I have included my code below. It i...