Code Funnies - Spotted Ina Piece Of Code - Decipher ?

Jun 21, 2012

I spotted this ina piece of code I am trying to decipher, and it made me giggle...

Public Const INFINITE As UInt32

Infinity in an unsigned 32-bit Integer.

View 6 Replies


ADVERTISEMENT

How Would I Multithread This Piece Of Code

Mar 3, 2009

On this piece Of code I want to multithread, beginning where the for loop takes the data out of the array arydata. The threads would all do the same task.

View 1 Replies

Translating A Piece Of C# Code

Aug 6, 2009

I am translating a piece of C# code into VB.NET using online convertors..[code]The VB.NET translation is not up to the mark and gives compiler errors Any VB.NET expert who can suggest what to change to make the code compile?url.

View 10 Replies

Program Crashes Because Of This Piece Of Code?

Apr 16, 2009

my situation is this; I have a search button which searches records with Surnames, when two or more records have the same surname, the first record appears and 4 navigational buttons appear, they are 'Go back to first record' (btnFirst), 'go back one' (btnPrevious), 'go forward one' (btnNext) and 'go to the last one (btnLast)'. All of these work properly except for 'go back one' (btnPrevious). When I click this and the record is currently the first one, the program crashes. Its probably a very elementary mistake but I can't figure it out. Here is the code for btnPrevious

[Code]...

View 30 Replies

Executing A Piece Of Code Before The Program Closes?

May 18, 2009

Having read the rules I don't have much code to show apart from these lines I want to have executed just before the program or a form closes.

If My.Computer.FileSystem.FileExists("File.file") then
My.Computer.FileSystem.DeleteFile("File.file")
End if

View 2 Replies

Get Time That A Piece Of Code Toke To Execute?

Feb 16, 2009

How can I get the time that a piece of code toke to execute ?

View 3 Replies

Get A Quick Piece Of Code To Close All Non Visible Forms?

May 30, 2010

I am starting to debudg my application in depth, and have realised that at certian points, if you close what appears to be the only open form, the application stays open. I was just wondering if there exists somewhere, a list of all open forms that you can view during debugging?Alternatively, is there a quick piece of code to close all non visible forms?

For Each frm In Application.OpenForms
frm.Close()
Next

Doesn't seem to work

View 1 Replies

Piece Of Code To Only Execute Scoring Algorithm At Certain Times

Dec 15, 2011

I have a standard scoring algorithm but I need to help on a piece of code to only execute the scoring algorithm at certain times.I want it to be triggered by dates, but the problem arises if the program is used after 2 (or more) dates have passed, the first date will not be added as the second date is the newest and therefore the one that triggers the scoring algorithm. - The scoring algorithm gets the scores for that week, which are stored in a text file.

View 5 Replies

Piece Of Code Which Loads Either French Or English Text?

Apr 1, 2011

I have a piece of code which loads either french or english text and 2 link buttons that allow to switch between.

<%
if publierFR = 0 Then
if publierEN = 0 Then

[code].....

View 1 Replies

VS 2008 Piece Of Code Involving Threads And Events ?

Nov 25, 2009

This is a very simple piece of code involving threading and events. I am just refreshing the old grey matter as I find myself off work sick for a period of time.

Code:

Imports System.Threading
Imports System.Threading.Thread

Module Module1

[CODE]...

View 5 Replies

Insert A Piece Of Html Code Into Web Browser Control In VB 2010?

Aug 15, 2011

I am trying to insert a piece of html code into a web browser control in vb 2010. i have tried the webbrowser1.documenttext function but cant seem to get the browser to run the html code.

View 7 Replies

VS 2008 : Execute A Piece Of Code At Set Intervals Without Using Functions Or Timers?

Jan 7, 2010

How can I execute a piece of code at set intervals without using functions or timers?

View 3 Replies

Make A Blackjack Program - Execute A Different Piece Of Code Each Time A Button Is Pressed By The User?

Nov 22, 2010

I am trying to make a blackjack program and I need to execute a different piece of code each time a button is pressed by the user.

View 5 Replies

Code/regular Expression/magic That Can Detect If This Text Contains A Piece Of SQL Query Instead Of Normal Harmless Text?

Sep 21, 2010

I came to a company that already has a fully grown project... but coders that worked here before me didn't follow conventions and didn't use parametrized SQL queries... as a result there is over 1000 places in a very huge project that can possibly be vulnerable to SQL injection...

I need to find a solution that will automatically detect if there is an SQL injection in the code. So, for example there is a form which allows user to enter comments regarding a product, which will be sent to database on submit... how can we make sure that a user didn't enter a harmfull query instead of a normal text?

Is there any advanced code/regular expression/magic that can detect if this text contains a piece of SQL query instead of normal harmless text? I will accept any links, pieces of code in any language or even commercial software that will do that for me.

View 5 Replies

Code To Load The Already Compiled Yahoo Files To Execute The Code Again, Without Having To Recompile The Code?

Dec 8, 2011

I have some code to execute code at runtime...

Here is the main

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If TextBox1.Text.Trim <> "" Then
If TextBox2.Text.Trim <> "" Then

[code]....

When the button is pressed, it all works and the following files are created: yahoo.dll and yahoo.pdb My question is this: What is the code to load the already compiled yahoo files to execute the code again, without having to recompile the code?

View 1 Replies

VS 2010 Convert VB6 Code To VB2010 Code From "The Most Amazing VB6 Code Ever" Thread?

Jul 19, 2011

This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.

[Code]...

View 39 Replies

Spotted A With MVC 1.0 Handles Strong Types When Using IDataErrorInfo?

May 13, 2010

I wanted to ask this question here rather then at the asp.net site (it takes too long to get an answer) because I think I have found a problem with how MVC 1.0 handles custom classes that implement IDataErrorInfo when using view binding. Not sure if this is a problem in v2.0 but I have never heard it mentioned.

Here's a little background, in MVC if I want to have strongly typed view, I create a class that basically holds the post information for me. MVC binds the form fields in the POST to the class properties of the same name for me automatically when I do this rather then implementing the ViewData dictionary.

[Code]...

View 2 Replies

Another OPTIMIZING Macro Vba Code For Excel 2007 - The Code Is A Sort Of Transposer For Data

Sep 9, 2011

this code was not done by me originally and there are some thigns here i dont quite understand i have altered it a bit from my coworkers code to suit my data and it works. but too slow. and when i have 4000+kb excel files it might freeze altogether. ( I have checked tho that when and after this transposer runs it will still be within the excel row limit, i had done calculations before and made a macro to automatically split excel files based on number of columns and rows to make sure this is so ). This code seems to start out fast then goes slower the longer it runs. at least this is what it seems liek to me.

[Code]....

View 2 Replies

Convert Excel 2007 Macro Code To Correct VB 2008 Code?

May 26, 2010

i recorded the following macro in excel 2007:

[Code]...

View 3 Replies

Restricted Textbox Code (Specifically, Building A Class Library With Code)?

Jan 2, 2012

I recently found this code (provided for third party use on another VB site), however,ll of my attempts to insert it into a class library have failed.I open a new class library and past the code in, and immediately get several errors pertaining to how certain objects can't be found. I find it it is crucial to use this code, unless someone can suggest to me another example of existing code that will do the same thing: make a restricted textbox who imputs can be restricted, that can handle pasting, shortcuts, text property setting, and script-entered text.

Option Strict On
Imports System.ComponentModel
Public Class RestrictedTextBox

[code].....

View 9 Replies

Size Of Compiled Code Into MSIL Necessarily Correlate To Code Speed?

Nov 24, 2010

I have been playing around with different types of native code operations in Visual Basic and then inspecting the code with Reflector to see what kind of MSIL is produced. For example, I wondered, in a one line If-Then-Else different than an If-Then-Else split onto multiple lines, ie.

[Code]...

View 3 Replies

Write A Code For Serial Ports Without Sucess But The Code Does Not Throw An Error ?

Feb 20, 2011

what is wrong with my code and I get no feedback from my button click event, i have imported. ( code Below) and i have tied differrent combinations of the code without sucess.maybe add extra to my code for the list to show open Port or closed ports.

Imports System.Management
Imports System.Management.ManagementObjectSearcher
Imports System.Management.ManagementNamedValueCollection[code].....

View 9 Replies

E.graphics.DrawSpiral Okay Folks Here Is A Code Update From Code Have Posted Yesterday Using An Extension Method?

May 1, 2012

This code is for 2008, 2010 and later versions of VB.Net as it uses an extension method.Please note: If you are using an earlier version ( or you do not like extension methods ) please see the next post.Here is the code I posted on Monday April 30th, 2012.>>Now you can specify the startRadius to be

View 7 Replies

VS 2005 Remove The Box (0x0A) Unix End Line Code; Then Replace It With CR+LF Normal ASCII Code?

Dec 13, 2009

I have this string just down loaded of a Unix server. I would like to remove the box (0x0A) Unix end line code; then replace it with CR+LF normal ASCII code. Also, I would like to do the replace before I save the data, while it in memory.

View 14 Replies

VS 2010 Bar-code Font With A Library That Converts Text To Proper Format For Bar-code Readers

Jan 18, 2012

I had a weird series of errors involving e.Graphics.DrawString() when painting a panel.I am using a barcode font [Code 128] with a library that converts text to the proper format for Barcode readers.That's fine, however, when I draw it to the panel, that's where things stop being fine:But, here's where things get funky. When I put it into a TextBox instead of drawing it via Graphics.DrawString(), everything is peachy:In fact, the TextBox one looks much better than the Graphics.DrawString() one! Am I doing something wrong?[code]

View 2 Replies

MSI Returned Error Code 1638 When Re-Installing Visual Studio 2008 - .NET Framework | Dream.In.Code

Jan 9, 2012

I realize this post is rather long, but I wanted to give all the information up front instead of people having to ask me for more information.At the end of the re-installation of Visual Studio 2008, there is this message:

"Microsoft SQL Publishing Wizard: [2] Error: Installation failed for component Microsoft SQL Publishing Wizard. MSI returned error code 1638" in the log file dd_error_vs_procore_90.txt.

I have searched on Google for this whole message and found some references to this error, but I have done what they said worked for them and it did not fix the problem for me.When I searched for just "MSI returned error code 1638", I got that it cannot install something because it is already installed:"Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel".In Add/Remove Programs I see these two programs:

Microsoft SQL Server Database Publishing Wizard 1.3
Microsoft SQL Server Database Publishing Wizard 1.4

Are these programs/versions what the error is refering to? Am I safe to remove them and depend on the similarly-named item which would be newly installed with Visual Studio 2008 - "Microsoft SQL Publishing Wizard"? I still use SQL Server 2000 and 2005 on my computer, as well as 2008. I had installed VS 2008 on my computer before without this problem and also have VS 2005 and 2010.

View 1 Replies

Asp.net - User Enters Code Into TextBox, Code Gets Added To URL (using Session)?

Sep 1, 2011

I'm using ASP.net 4.0 VB,I am using a session variable to add a user entered code into the url of each page. I can get the code to show up at the end of the page's URL that my textbox is on, but what do I add to every page to make sure that the session stays at the end of every URL that person visits during their session? This is the code from the page that the user enters their user code.

Protected Sub IBTextBoxButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles IBTextBoxButton.Click
Session("IB") = IBTextBox.Text
Dim IB As String = Session("IB")
End Sub

[code]....

This is what I have in the page load of one of the other pages. What else do I add to make sure that variable is added to the URL of that page?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim IB As String
IB = Session("IB")
End Sub

View 3 Replies

Asp.net - Write/code Javascript(mouseover Event) Using C# Methods/ C# Code?

Jan 24, 2011

i am asking that can i use c# language to implement "actions" fired on "click side events" such as mouse over the reason for this stupid question is that i remember some syntax of registering functions for particular events of formview, which are call when the event occurs (yes there ispostback involved" is something like the above possible for client side events using c# or even vb.net

protected void Page_Load(object sender, EventArgs e)
{
Label3.Text = "this is label three";

[code]....

View 3 Replies

Auto-start Code On Open Then Close After Code Is Done Running?

Feb 15, 2009

I have a program that runs some code when i click a button on a form when done running the application ends. I want to automaticaly run the code when the users clicks on the exe. I have put the code that i want to run in the startup forms load event but that doesn't start

View 2 Replies

Exception Being Thrown In Designer-created Code Instead Of User Code

Sep 10, 2010

In my project, I have a local dataset (XSD) that I am using as local-temporary tables. I am getting a System.InvalidCastException when trying to access the field in one the tables. I believe this is because I my code is (incorrectly) not setting a field's value in a row before trying to access it.My problem is that the exception is breaking in the designer file and not in my code. As a result, I'm having difficulting determining which line of my code reading the field value before it has been set. Is there any way to configure Visual Studio to break in my code instead of in the designer created file?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved