Small Errors When Translating Code From C# To Program

Feb 19, 2012

I have almost completed a translation from C# to VB.NET, however, I run into some small errors[code]...

View 1 Replies


ADVERTISEMENT

Translating A Small C# WCF App Into VB (part 2)?

Oct 18, 2010

I recently asked a question about translating a code sample I found on on the internet from C# into VB and I was given links to websites that automate code translation [URL].. I am very new to VB and unfortunately the VB that the translators returned doesn't compile in Visual Studio 2010. I am hoping someone can help me fix the non-working portion of VB code.

Here is the C# code I am converting into VB:

[Code]...

View 2 Replies

C# - Errors Translating Regex From .NET To Javascript?

May 19, 2011

I have this piece of VBNet code that i would like to translate into javascript:

Dim phone_check_pattern = "^(+?|((+?[0-9]{1,3}))|)([ 0-9.//-]|([ 0-9.//-]+))+((x|X|((e|E)(x|X)(t|T)))([ 0-9.//-]|([ 0-9.//-]+)))?$"
System.Diagnostics.Debug.WriteLine(System.Text.RegularExpressions.Regex.IsMatch("test input", phone_check_pattern))

my translated result:

var phone_check_pattern = "^(+?|((+?[0-9]{1,3}))|)([ 0-9.//-]|([ 0-9.//-]+))+((x|X|((e|E)(x|X)(t|T)))([ 0-9.//-]|([ 0-9.//-]+)))?$";
alert(new RegExp(phone_check_pattern).test("test input"))

However when i run it it has error Uncaught SyntaxError: Invalid regular expression:: Nothing to repeat

(my VbNet code doesn't have any error though)

View 3 Replies

Get Errors When Run Code / Program Starts When Debug

May 8, 2011

I am not exactly sure what I am doing wrong. I need to convert Me.xCommissionLabel.Text = Format(Me.xCommissionLabel.Text, "currency") to a toString, so it displays a dollar sign, 2 decimal places. so I did this. Me.xCommissionLabel.Text = commissionLabel.ToString(CType("C", IFormatProvider))When I run the program and input the data I get: A first chance exception of type 'System.InvalidCastException' occurred in Commission Project.exe. [code]

View 7 Replies

Make A Small Program For Ticketing On A Parking For A Small Hotel?

Aug 27, 2010

I need to make a small programm for ticketing on a parking for a small hotel.So i have 2 Printers pariking In (for delivery of the tickets) and 2 Readers PArking Out.Both Printers and REaders are working Serial.So i need to poll the serial ports of the printers and readers every second.The data is stored on a SQL database so i need to read and write in the database.Can i do this with 1 PC and 1 programm or 1 PC and 4 programms that are runnning at the same time ?

View 2 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

VS 2010 Translating Code From C# To .net?

Apr 16, 2012

Just a quick question, what will this code be in vb.net? if this is the wrong place for this request.

[Code]...

View 1 Replies

Make Some Special Translating Program?

Jun 9, 2011

i'm starting to learn vb.net, and i trying to make some special translating program, its need to translate hebrew text into special letter sequence. the text input are: ב יית בי יי ים מתקדמים (which its means Construction of advanced buildings ) And the text output are: BPJJZ_BJPJJPJM_NZWDNJM according to the list i made (Attached picture).

[Code]...

View 17 Replies

Translating Decompiled Code - Function That Accepts An Item Name Its Cost And Its Quantity

May 6, 2011

I was wondering if someone could translate this code into a more understandable code. It is suppose to be a function that accepts an item name its cost and its quantity. and adds one more array element to ."items" variable and assigns the given name and cost and quantity.

Public Sub AddItem(ByVal strName As String, ByVal dblCost As Double, ByVal intQuantity As Integer)
Me.items=DirectCast(Utils.CopyArray(DirectCast(Me.items,Array),New Purchase(me.itemsCount + 1)-1){}),Purchase())

End Sub

This is the translation i made but i don't think it is correct.

Public Sub AddItem(ByVal strName As String, ByVal dblPrice As Double, ByVal intQuan As Integer)
Dim items As Purchase() = Me.items
Dim itemCount As Integer = Me.itemsCount
For itemCount = 0 To items.Length - 1

[CODE]...

View 3 Replies

.net - Translating C Code Using OpenSSL For Public-key Authentication To VisualBasic.NET Using System.security.cryptography?

Oct 20, 2009

I am trying to mimic the results of some C code that uses the OpenSSL library using the system.security.crytography library in the .net 3.5 world, and I can't seem to get it right. part of the issue is my understanding of crytography in general.

Here's what is supposed to happen:

I send a request for authentication to a device.It returns a challenge digest, which I then need to sign with a known key and return The device returns a "success" or "Fail" message.I have the following code snippet that I am trying to "copy":

[Code]...

View 4 Replies

Convert Small Snippet Of Code From C# To .net?

Oct 7, 2009

translate this c# code to vb.net , the online convertion tools dont seem to do a good job and my c# knowledge is not good enough. the main problem i have is how to write the code that is after "(new claimsRequest......"

protected void OpenIdAjaxTextBox1_LoggingIn(object sender, OpenIdEventArgs e) {
// Retrieve the email address of the user
e.Request.AddExtension(new ClaimsRequest {

[code]....

View 3 Replies

Small With Mouse Emulation Code That Works Mostly?

Feb 14, 2012

I have some code below that works mostly in vb.net but when it gets to ExtHubPort and after it doesnt work i think i might have incorrect formatting of code somewhere or a simple error because if I get it the same sounds as the vbscript except when mouse device is plugged in it gives me this error in device manager: "device could not start error 10". Here is the code but to plainly put it the code just adds an emulated external usb hub to the system's hub and then usb device to that hub:

Option Explicit On
Imports System
Imports Microsoft.Dsf
Module Test_Emulator

[Code]...

The msgbox's mark important areas that will help if you wish to debug this code. I have a codeplex page in which the project has the dlls for both 32-bit and 64-bit OS's but if you have the dsf runtime you can manually get them from the GAC (c:windowsassembly version and yes im sure because thats where i found them) and just paste into visual studios public assmeblies folder and it

View 8 Replies

Put Undo In A Small Program?

Jan 21, 2010

I want to put undo in a small program

View 10 Replies

Build A Small Program Which Will Allow Some One To Click On The Exit Button And The Sound Will Play And At The End Of The Sound The Program Will Then Close?

Apr 17, 2009

I am trying to build a small program which will allow some one to click on the exit button and the sound will play and at the end of the sound the program will then close. The sound clip is about 3 seconds long Here is what I have:

Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Public Class Form1
Private Dsound As CSoundDevice

[code]....

View 14 Replies

Small Error On The Save File Dialog Code?

May 11, 2009

i'm working on saving a text file.. the code i have, works without a question, no problem there.Imports System.IO

[Code]...

View 7 Replies

VS 2005 : Dump A Small Html Code In A Variable?

Jul 12, 2010

how can i dump a small html code in a variable? do i need to take array ?i need to write below line to a file "as is"

$a = "<style>"
$a = $a + "BODY{background-color:skyblue;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"

[code]....

how can i make VB turn off recognition of it's operative characters like $,<,>,= etc. which appears on above code but i need to dump it "as it is" in a file during runtime.

View 12 Replies

VS 2010 Form A Code For A Small Arrays Manipulation?

Dec 25, 2011

I need help to form a code for a small arrays manipulation. The input data are known: they are two integers "N" and "s". An integer "N" is always divisible by 4.I need to create an array of "N" members, by repeating (N/4 times) this sub-array: 1,2,2,1 (always is the same). In the picture, this is shown in blue. Then I need to add the same array to the existing array, but shifted for "s" places (red array). The result is "yes" if each sum in new columns is always the same (3). Otherwise the result is "no." note there is no need to draw or display something (DGV, table ...). The required result is only "yes" or "no".

View 8 Replies

Get Rid Of A Blink At The Start Of A Small Program?

Jan 25, 2011

I have been trying, without success, to get rid of a �Blink� at the start of a small program.

My program opens with a title page (Form2, which is visible at 100% Opacity) that I want to fade after a few seconds, this works fine except that at the first reduction of opacity, Timer1's first 'Tick', the whole of Form2 blacks out for a moment. (Blinks)

I have a short demo program to show what I mean but don�t think I can attach it to this question. The code is shown here but I don�t know how to include Form1 and Form2. They are very simple however, they�re both Size 1000,600
Form1 has a single Button (Exit) and a Timer; Form2 has a full-size photo as background.

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]....

I developed the code on a XP machine, but I also get the same 'Blink' on my Win. 7 Pro machine.

View 6 Replies

Small Program To Get Text From A DAT File?

Sep 19, 2011

i have a small program to get text from a DAT file. the program gets all the text and puts it into a rich text box (rtb1) then I click a button (btnformat) to split the text in the dat file into indexes so that I can output the indexes that I want to an excel file. This program works when I use small amounts of data but if I use say 800 lines of text the program crashes/ can't handle the volume of data and just stalls.

View 14 Replies

Getting Errors In Code VB 6.0 To .net?

Aug 2, 2010

I'm suppose to do an application as follows..I should dial a modem with Phone number using Gsm Modem. i Searched a lot in Google for some source/idea's in vb.net but i dint get .I have code in vb6.0 so I converted that in to vb.net. In that i'm getting errors correct my code.Here is my code.I'm fresher as well new to VB.net programming.Because of stress for urgent completion of work,not able to spend much time.

[Code]...

View 7 Replies

Keep Getting Errors From Code

May 8, 2011

I'm new to visual basic 2008 and have worked on this question for quite a bit before deciding to come to this website and asking for someone to walk me through it."Write a program that requests an amount of money as input and displays the names of all liquids for which a gallon could be purchased with that amount of money. The information in the (table 6.2) should be read from a file. As an example if the user has $2.35, then the following should be displayed in the list box: "You can purchase one gallon of any of the following liquids:Bleach Milk".[code]

View 1 Replies

Make A Small Program To Encrypt Files Using AES

Apr 11, 2009

i am trying to make a small program to encrypt files using AES, and then have the password from the AES encrypted using RSA for its use of public keys. i've got the AES part working fine and i found a good RSA tutorial here url....but after i encrypt the AES password (which is saved in a .txt file) using RSA, then i try to decrypt it again, it comes out as an empty .txt file!

View 4 Replies

Created A Small Program Which One Uses The SQLite Database?

Apr 28, 2011

I created a small program which one uses the SQLite database. I have a simple table employees, composed of the name and password. I can not write sql script correctly. application code is:

Imports System.Data
Imports System.Data.SQLite
Public Class Form1

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click

[Code]...

View 4 Replies

Created A Small Test Program For Faxing

Mar 28, 2006

I have created a small test program for faxing.On some machines it works and on others it throws the following COM error when trying to send the fax:[code]Here is the source code from my test application.All it requires is a reference to FaxComExLib.[code]

View 15 Replies

Small Program To Change The School Wallpapers?

Sep 4, 2010

im new to these forums and was working on a small program to change the school wallpapers. i want the user to be able to choose the imageand not have to put it in a secific directory could anyone please advise me on how to do this

[Code]...

View 1 Replies

Small Program Which Would Display One Window(frame)?

Oct 10, 2009

I made a small program which just is one window(frame) i want to put this prog. in my PC when i restart my computer this window display.

View 11 Replies

Write A Small Program For ITunes Using Windows COM?

Apr 20, 2010

I are trying to write a small program for iTunes using Windows COM. We are able to talk to iTunes and create popup boxes that show the current track, and a few other small things. However, when we try to set this info to a Label for example, we get:

InvalidOperationException was unhandled by user code Cross-thread operation not valid: Control 'Label1' accessed from a thread other than the thread it was created on.

The program then hangs and locks iTunes from closing. I believe the issue is the event handler I have created, which I know very little about. We are using VB 2010, so that may change some things. We followed a rough example from a forum post HERE. If you scroll down the orange text, you will see a reply right after by Will Hughes with a "Handles iTunes.OnPlayEvent". If I add this to the end of my event handler, I get:

Handles clause requires a WithEvents variable defined in the containing type or one of its base types. Not sure if its important to the issue or not, but I found it curious. Our code is shown below.

Imports iTunesLib
Public Class Form1
Private iTunes As New iTunesApp

[Code].....

View 3 Replies

Written A Small Program To Set Wallpaper On The Desktop?

Oct 5, 2008

i have written a small program to set wallpaper on the desktop when i change the wallpaper then if I refresh the desktop then problem is that,wall paper is disappeared and a blue screen comes.secondly i want few changes i want to set wallpaper as Tile,Center and stretch i want to use radio buttons on the form for this purpose so how can i make these changes.

View 1 Replies

Create A Small Application That Can Make Small Calculations?

Feb 1, 2010

On form 1 , i have a number of buttons that open up different websites.What i want to do is when i click a button on form 1 , i want forum 2 to show ( Form2.show() ) , Form 2 will have a list (Buttons) of internet browsers.

View 4 Replies

Show Me Small Lines Of Code That The Users Are Unable To Move To Form?

May 23, 2009

show me small lines of code that the users are unable to move to form?

i already search on google and i found some code.. but it compose of many-many lines of code and i cant understand... i want a small lines of code..

View 11 Replies







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