# [RESOLVED] Need Help With 8 Bit Binary Number Manipulation

May 4, 2012

GUI: textbox1.Text, button, textbox2.Text What i want to do is when the user inputs an 8 bit binary number The program finds the places of ones and outputs them For example: user inputs 00010011, the program outputs a 4,1,0 because the 7th place is the one closest to the left and the 0th place is the farthest, e.g. 76543210 is and in the 8bit string the 4th 1st and 0th are ones I was thinking of something like this:

[code]...

## Resolved Binary To Denary And Reverse Converter?

Mar 30, 2010

for homework an optional task was to create a binary to denary and denary to binary converter, using console application in VB.NET .. anyway i gave it my best shot however and it all works except for the denary to binary conversion, can someone please help me out? not been programming for very long so my code might be a bit messy or badly written i dont know,

[Code]...

## Convert Decimal Number To Binary Number With Fixed Bits?

Oct 29, 2010

I want to convert numbers from 0 to 15 like that

[Code]...

Problem is that when we convert 2 to binary number it gives only 10 in binary, but i want to convert 2 to 4 bit binary number 0010.

## IDE :: String Manipulation - Return Number Infront Of X

May 2, 2009

I have a very simple question: I have a string that may say "3x itemname", or "32x itemname". How do I get it to return the number infront of the x?

## Unformat A Phone Number Using String Manipulation?

Apr 27, 2011

I need to take a fully formated number:

Ex: (111)-111-1111

And take out all the none integer characters, such as parens, hyphens, and spaces.So far I have:

sNumber = txtNumber.Text
If sNumber.Contains("-") Then
sFixed = Replace(sNumber, "-", "")
lblNumberOut.Text = sFixed

[code]....

sNumber and sFixed are both declared class/global level. The thing is, I've made two separate if's, i've made the second one an elseif, It just only enacts one if statement, such as only taking out the hyphens and not taking out the parens, or vice versa. I'm thinking i need to declare multiple sFixed (sFixed1,2,3, etc) but that seems terribly inefficient.

## String Manipulation - Separate Three Fields Of The Phone Number And Display In Three Separate Text Boxes?

Feb 23, 2012

I created a telephone number form where the user enters the telephone number in a text box as (nnn) nnn-nnnn. The first 3 digits in parenthesis are the ISD code, the next three are the area code and the last four are the local number. I need to separate out these three fields of the phone number and display in three separate text boxes labeled appropriately. Now, suppose the user enters the phone number in a text box as a continuous string of 10 digits, where the first three represent the ISD code, the next three represent the area code and the last four represent the local number. I'm lost as how to change this string into the form (nnn) nnn-nnnn. This is what I have

[code]...

## Generate Random Binary Number?

May 11, 2010

i'm beginer in this forum and new in vb6.how to generate random number in vb6?

is it posible to represent variable in binary?

## Get Record Number In Binary File?

Nov 2, 2009

Recently I experiment with the binary file type. I have this structure[code]...

It works. And now, in the load event of the form I want to know, how many records (structures) are stored in the file.

Another question: how can I search and seek in the file (structure to structure, not byte to byte)?

## First 2 Bytes In The Binary File The Number Of Records?

Jun 7, 2011

The question is quite simple for all of you . I have a binary file . A description for this file says that

[Code]...

## Create An Application That Allows User To Type In A 32 Bit Number Using Binary System

Jul 13, 2011

Can anyone help me to break down the instructions for this assignment.Create an application that allows the user to type in a 32 bit number using the binary system, and convert that number into the decimal numbering system.For example, the user types 000000000000 0010 (where there are 30 leading 0's, 1 then 0 from left to right), and the output would be 2.The user will type a string that is 32 characters in length.A For loop 'reads' each character using the x.substring(i,1) where i is the current character we are reading and 1 means one character only,and x is the entry the user typed (use a Textbox to get the entry but Inputbox is also ok).When you start at the first character (from the right) then that value is to be * 2 ^ 0 then the second character is to be * 2 ^ 1, then the third character is * 2 ^ 2, hence:( x.substring(i,1) converted to Integer ) * 2 ^ j represents the decimal value of the current number (0 or 1) we are reading.A variable is needed to accumulate all those values.After the loop is done, display the accumulated value.To test this code on a simple version, enter a 4 digit binary number, where 0010 is decimal 2, 0110 is decimal 6, 0111 is 7, and 1000 is 8.

My understanding is the user must enter 32 digits into a textbox. The textbox should place limitations that only allow the digits "0" and "1". This error could be displayed to the user with a messagebox that then asks to reset the value orginally inputted into the textbox. My understanding is I should continue creating the formula of the position of each character where the third character is *2^2, fourth is *2^3, fifth is *2^4 and so on? I don't understand the formula and how it works.

## Creating A Class That Searches A Binary File For A Specific Customer Number

Jan 4, 2012

I am creating a class that searches a binary file for a specific customer number. I am using a binary search that keeps on slicing the file in half until I find the customer number while is sorted. Once it finds it I am positioning it at the first instance of that Customer number as there can be multiple records with the same Cus Number.

Now here is my question. I now need to loop through this Customers records and do some data base searches. Since I want to make my class as generic as possible what should I pass back to the calling class? An Array with all their records. If I do this I have to loop twice, once in the class and once when it passes the array bac to the original calling class?

[Code]....

## Convert A String Containing A Binary, Octal And Hex Number Into A Decimal String?

Jun 7, 2009

I'd like to convert a string which contains a decimal number into string that contains the binary value, the octal and the hexadecimal value of that decimal number.Afterwards I also like to convert a string containing a binary, octal and hexd. number into a decimal string.Basically I'm looking for the functions:

dec2bin
dec2oct
dec2hex
bin2dec
oct2dec
hex2dec

I'd not prefer to rewrite a function, I'm sure the framework must have these functions already.

## Resolved How To Play Sounds In Vb 9

Oct 29, 2009

i wanted to make a piano with visual basic 2008 and i searched around the internet to see how to play a sound but my search returned results relating only to visual basic 2005 & 6 so i am again forced to waste your time (sorry about that) oh and i also have the wav soundfiles i only want vb to read them in the final exe

## VS 2005 The Remote Name Could Not Be Resolved?

Feb 19, 2010

When trying to connect an URL, thru my vb.Net application using System.Net.WebClient object,I got the following exception

## VS 2008 [RESOLVED] ComboBoxes

May 11, 2012

I have 3 Combo boxes that have number 1-9 in each, i would like to make it so that if the first one is set to 9 then the and the second it set to 8 then the first 1 is set to 1, i need them to only equal 9 through all the boxes?

## [RESOLVED] Application For 64 Bit Computer?

Apr 2, 2009

I wrote a small application for a friend that opens a Excel sheet, get's some data from it and stores that data into a file. I compiled it for AnyCPU (I also did a compile just for his 64 bit machine, same result).Here is the problem:He is able to run the program on a 32 bit computer without any problem, it just won't work on his 64 bit computer.Here is the error he is getting App failed to initialize properly (0xc0000135)

Is this my problem or could this be his problem? As far as I can tell I'm all up to date with VS2008.Is there somewhere I can look specifically what the latest build is for VS2008? I am using VB2008.

## [RESOLVED] How To Make A Key Generator

May 3, 2011

I m new to VB and i just need a special keygen which i dont know if exists yet or not.First off i'd like to mention that i dont want to make a keygen that will generate a random key out of keys that i have to manually code in (cases) E.G.

[code]...

I want to know how to make a keygen that will generate a letter/number randomly out some example letters which would need to be defined.E.G.Random number out of 0-9 (0,1,2,3 etc) Random letter from A-Z (A,B,C etc) And then obviously display generated key in TextBox. Ideally i would like to improve this more but if i could get the basics then i would move on from there

## [RESOLVED] Looking For A Word In A Sentence?

Oct 14, 2009

I am looking for a way to display a whole sentence if a word that Iam searchign for found in that sentence:Here is an example:

[Sun Aug 30 2009 04:01:12] Ping failed.
[Sat Aug 29 2009 04:01:10] Ping failed
[Fri Aug 28 2009 04:00:37] Ping failed

[code]....

## [RESOLVED] Run Exe As Embedded Resources?

Nov 19, 2011

I am wanting to use a vnc installer as an embedded resource, and if the computer running the program does not have vnc installed then typing in a password will install vnc. I have tried everything I can think of and running the process from my computer works, however when ran on a different computer i get the error "File not Found". I am sure I am not calling the embedded resource correctly. I am using Process.Start(" ightvnc.exe /S")

## Resolved Integer Double String?

Sep 8, 2009

i've got another problem with my coding in this sub...

Private Sub buyLemon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buyLemon.Click
lemonL.Text += 1

[code]....

## Resolved Stumped Regex Works In C# But Not VB?

Jan 12, 2010

I'm working through the Pro ASP.NET MVC Framework book by Apress (which is great, btw) and it's in C# although we mostly work in VB so I'm "translating" the examples along the way. So far so good but I ran into something that has thrown me.Long story short we need to validate that the string the user gave us as an email address. This returns true in C#:

Console.WriteLine(System.Text.RegularExpressions.R egex.IsMatch("Me@me.com", ".+\@.+\..+"));

But this returns false in VB:Console.WriteLine(System.Text.RegularExpressions.R egex.IsMatch("Me@me.com", ".+\@.+\..+"))

## VS 2008 [RESOLVED] ListView Changes Mid Code?

Aug 27, 2009

This one is causing me a lot of frustration, and as far as I can see, it should work. What I have is a form with 9 ListViews (ListView1 through 9), and I want to add items to them.The issue is, I have a routine that sets which ListView to use. Say I have set it for ListView4, it works initially on the first file, but after one line of code. it reverts back to ListView1 for the remaining files. (itmModelItem = lvwModels.Items.Add(ModelName) in AddModel.

[Code]...

Apr 9, 2010

1. Am I doing this right?

2. If you run this on your machine does it take 39 seconds to return your IP address? [code]

## [RESOLVED] Simple 3D Graphics With DirectX

Jun 6, 2010

I'm just having some difficulty with nitpicky details. To give you a gauge of the level of programming I'm at I'll just tell you about some of the work I've done. Of course, you can skip down to the last paragraph if you don't have the time.I've created an emulator for a programming language I call "Blue Code". It's kinda a spoof on Redcode, which you may have read about before. You load programs which use simple commands like add, divide, copy, jump, split (like making a new thread), etc. You can load multiple programs in and each instruction sits on a line of a circular memory. Then each program takes turns trying to get the other to run an illegal function, at which time it looses. I think it's quite a bit better than Redcode actually.I also wrote a program a couple years back (when I was 13?) that draws fractal trees, it's quite fun.

So, I have a pretty good grasp on VB, but recently I got into 3D graphics using the Direct3D library. Unfortunately, the function I'm using to save meshes is not working. I know the rest of my program works just dandy because I've loaded quite a few sample meshes. Now, I've come to the conclusion that my saving code is irreparably broken, so I won't even show it to you. What I need is somebody to write an outline of what I need in a saving function, or, better yet, actually write a saving function which I can customize to my purposes. The parameters are, a somewhat unconventional List(of List(of CustomVertex.PositionNormalTextured)), List(of Material), and List(of String). List of lists includes a bunch of lists of vertices I wish to use, where each list represents a subroutine. The list of strings and list of materials represent texture file names and surface materials respectively.

## [RESOLVED] Transfer Of Control Array VB6?

Dec 28, 2011

I have been programming in VB6 for a while now and am gradually trying to get to grips with .Net (VB 2005)I am tryng to transfer some of my programs from VB6 to .Net with some success but have got a little stuck on trying to transfer what was a control array to .neto try to sort this i have set up a form in VB6 with 4 Vscroll bars and 4 Text boxes.Vscroll1(*) & Text1(*) where * is 0-4when you change the value in any scroll bar then the associated text box value changes.

Private Sub VScroll1_Change(Index As Integer)
Text1(Index).Text = VScroll1(Index).Value
End Sub

[code].....

## Forms :: Resolved Update Richtextbox On A Different Thread?

Nov 12, 2010

I've been searching around for ages now but can't seem to find what I'm looking for, anyway came accross this wonderful place so thought ay I'm creating a rewards system for school where pupil earn points for good behavior which they can then use to purchase things like a packet of pens. (They can also have points deducted for bad behavior)

## Resolved Normalize Path With Length More Than 260 Chars?

Feb 8, 2010

My issue is to combine two paths which one or both of them may contain double dots. I used Path.Combine(string, string) and the returned string is still a long path as a result of concatenating these two paths. Single or double dots are not eliminated.

So, I tried to use Path.GetFullPath(string) method with the concatenated path as the argument.PathTooLongException is thrown because this path has more than 260 characters. However, if this path is normalized, it won't exceed the maximum characters for a file path.

[Code]...

## Resolved Shut Down The Computer When System Is Locked?

Sep 21, 2010

In uTorrent the system shuts down whether the user is logged in or the system is locked, how is that possible?Also I would like to know how to detect if the system is locked or not because if they are logged in I, like uTorrent, would like to prompt the user that the system is about to shut down and give them 30 seconds to cancel it.

Process.Start("shutdown.exe", "-s -t 05")

[code].....

## VS 2008 - FTP Exception - The Remote Name Could Not Be Resolved: 'unkn'

Jul 12, 2010

I have another problem:

Try
GetPass()
GetUser()
GetPath()
[CODE]...

Bolded line makes an exception: The remote name could not be resolved: 'unkn' I guess it has to do something with threading, and path doesnt generate correctly username, password, and pth are generated from objects in another form, so i did it like this: Dim newfrm As Form1

And then acces the objects that hold user, pass... like: newfrm.textbox1.text

So, why do i get this exception then if im doing it the right way, and how do i get this to work?

## VS 2008 : Error - Web-exception : Remote Name Could Not Be Resolved

Nov 22, 2009

I am trying to read in a Web Page, using the code below.However it keeps failing when it runs the line s = client.OpenRead(remoteUri) The error I am getting is

The remote name could not be resolved:[URL]

Imports System
Imports System.IO
Imports System.Net
Imports System.Text.RegularExpressions

[code]....

## VS 2008 [RESOLVED] Threads And Problem With Form

May 26, 2009

Hi

I have a thread that it calling many processes.

While the processes are executed (spends some seconds or minutes in completing all the tasks) I show form "Please wait to complete all tasks".

But one of these processes I have to show a form because the user has to choose a few data. But the problem is that this form is showed minimized.

Already I have tried to show it maximized and to bring it to the front but it does not do it.

how I can show this form to front and maximized?

My actual code is:

f= New frmLPlantillas
f.WindowState = FormWindowState.Maximized
f.BringToFront()
If f.ShowDialog() = DialogResult.OK Then
value1= f.xxxx
value2= f.zzzzz
value3= f.aaaa
value4= f.bbbbbb
Else
Return False
Exit Function
End If

## [RESOLVED] Centering An Image In A Group Box As It Is Resized?

Sep 24, 2011

Basically, I have a ListBox with a list of items that correspond to pictures.I have it set up so that when you selected the first word on the list (index 0), then the image 0.png is displayed (index 1 = 1.png, etc) in the Picture Box and the Picture Box resizes to fit the Image.

[code]...

This^ works fine, but I want to center the picture in the group box that it is in each time a different image in selected.My solution was this:

[code]...

No compilation errors, but it^ doesn't center the image. As a matter of fact, there's no noticeable difference at all.

Mar 8, 2011

I have been searching for quite some time, and while this might be easier than I am making it, but this is the first time I have tried to do something like this. My issue is that I am creating a pdf and need to include am image that I have to download from a dynamic URL. The issue I am having is how do I get the image saved to a file on our server? As far as I have seen, there is not a way to directly put in the image into the pdf - but if you know a way to do this, that might work instead.

## Error: System.Net.WebException: The Remote Name Could Not Be Resolved:'site.com'

Jun 10, 2010

I created an application which posts data to a url using webrequest.It worked fine on my computer, but when another client runs the application , he gets the following error:

System.Net.WebException: the remote name could not be resolved:'site.com'
at system.net.httpwebrequest.getrequeststream()..

## Forms :: Resolved ClassicXP/win98 Style GUI On Vista?

Jan 26, 2010

my application has "picked up" the old style button design. In Vista the buttons have a slight shadow / 3d effect, however, my application appears not be using the default style and instead applying the older XP, Win98 typ appearance. At first it didnt bother me, however, not its annoying and rather than rip all my code out and apply it to a new project, i would prefer to remove the offending code call.

Its a long shot, but i thought i would see if anyone here knew what might be causing it?

## Forms :: Resolved Deleting Lines In A Text File?

Jan 28, 2010

Ok, I'm new so go easy on me. I don't know if this is in the right section, so if it's not, sorry.

Goal: To delete extra lines in a text file.

[Code]...

## Windows 7 Crystal Reports Doesn't Work [resolved]

Nov 5, 2009

Visual Studio 2005 SP1cr10 developer also installedOn XP machine, works fine. Got a Windows 7 machine(64bit and all) and copy over the project, run it and can't, I get an error in each crystal report gets an error [code]I take these lines out, and no more error for the report. Since there are like 40 reports in a project and there's 5 different projects that would have to be altered, this will be a pain. And I'm not the only developer. Another developer, on Vista and another will be coming in on XP, don't have this issue. I've tried uninstalling everything Cr and visual studio, then reinstalled visual studio and ran it, same thing, then installed SP1, same thing, then updated security fixes, same thing. CR10 isn't installed. I've removed and added the references back ,they seem to be the exact same versions.

## [RESOLVED][2008] DataGridView Refresh / Jumps To First Entry

Feb 10, 2009

I'm successfully refreshing my DataGridView/Access DB by using the following.[cod]My only problem is after the refreshes the DGV rolls back to the first entry.Is there anyway to have it refresh but stay on the same line?

## Forms :: Resolved Search And Display ArrayList Stored In A Hashtable?

Mar 25, 2009

I am new to VB.net and I am trying to work out an exercise from a book I am reading on VB. Basically I am storing some book information in a hashtable using a class called Book to store the book information. I am trying to work out my Search and Display All procedures. My Search will work for the first value in my arraylist but not for any other values. I even added the ISBN to my book class to try and use this as a search point. The ISBN is used to pull the item from the hashtable as well.

In the main code I am having problems with the ButtonSearch and ButtonAll.

[Code]...

## [RESOLVED] Error - Exception Of Type 'System.OutOfMemoryException' Was Thrown?

Nov 4, 2009

my application occurs an error "Exception of type 'System.OutOfMemoryException' was thrown." when trying to import xlsx file to sql server.

[Code]...