473,396 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to convert the C# code below to VB.NET?

yxq
How to convert the C# code below to VB.NET? thank you.

AddLogicalDrive(((char)('A' + i)).ToString() + ":");
Jan 4 '08 #1
3 1603
AddLogicalDrive((ChrW(Asc("A"c) + i)).ToString() & ":")
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to Ruby
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
"yxq" wrote:
How to convert the C# code below to VB.NET? thank you.

AddLogicalDrive(((char)('A' + i)).ToString() + ":");
Jan 5 '08 #2
David,
AddLogicalDrive((ChrW(Asc("A"c) + i)).ToString() & ":")

It is the best answer of course until now and probably the way a good
converter will make it like this, however I find this kind of questions
always funny.

In my idea there has to be a kind of check if the indexer "i "cannot be less
then 0 and more then 26, at that moment the chr should be enoug althoug I
would normaly also advice to use the chrw. In other words as you don't use
the ascW there is no need to use the chrW.

I know what you can write, however it is not critique, I was just curious
about the answers and in this case there was something where this did aply,

Cor

Jan 5 '08 #3
Thanks for pointing that out Cor.
We are currently correcting Instant VB to be able to better detect the need
to use ChrW and AscW to simulate C# 'character math', and this inconsistency
(using ChrW, but not AscW) needs to be addressed.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to Ruby
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
"Cor Ligthert[MVP]" wrote:
David,
AddLogicalDrive((ChrW(Asc("A"c) + i)).ToString() & ":")


It is the best answer of course until now and probably the way a good
converter will make it like this, however I find this kind of questions
always funny.

In my idea there has to be a kind of check if the indexer "i "cannot be less
then 0 and more then 26, at that moment the chr should be enoug althoug I
would normaly also advice to use the chrw. In other words as you don't use
the ascW there is no need to use the chrW.

I know what you can write, however it is not critique, I was just curious
about the answers and in this case there was something where this did aply,

Cor

Jan 5 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rodusa | last post by:
I am having problem to apply updates into this function below. I tried using cursor for updates, etc. but no success. Sql server keeps telling me that I cannot execute insert or update from inside...
2
by: Brian Basquille | last post by:
Hello all, Is there any way to convert, what i think is, source code in C into C#? Can't find any resources online for doing it anyways.. just C# to VB.net and vice-versa. The problem with...
0
by: NoSpamForMe | last post by:
I am currently a java programmer, with some knowledge of the C# language but very little knowledge about ASP.NET, and I am know wondering if someone can *translate* the java servlet code below to...
7
by: Alan Silver | last post by:
Hello, I have installed the 2.0 framework, and am looking at converting some of my 1.1 pages to use partial classes. I don't (yet) have VS2005, so I'm doing this by hand, but am having problems....
6
by: patang | last post by:
Could someone please tell me where am I supposed to put this code. Actually my project has two forms. I created a new module and have put the following code sent by someone. All the function...
20
by: Niyazi | last post by:
Hi all, I have a integer number from 1 to 37000. And I want to create a report in excel that shows in 4 alphanumeric length. Example: I can write the cutomerID from 1 to 9999 as: 1 ---->...
5
by: sjsn | last post by:
Basic C++, just started this course in school... So I'm very limited. What I'm at doing is, below I have a variable named inputTemp, which is the product of a char, F = Fahrenheit, C = Celsius...
2
by: slizorn | last post by:
error is as stated in the topic above: error C2440: '=' : cannot convert from 'char *' to 'char' code is below void handleOneLine(string string1) { char * cstr, *p; int counter; string...
9
by: myotheraccount | last post by:
Hello, Is there a way to convert a DataRow to a StringArray, without looping through all of the items of the DataRow? Basically, I'm trying to get the results of a query and put them into a...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.