Solved

VB 2010 Express - Combining strings and objects

Posted on 2013-05-30
1
249 Views
Last Modified: 2013-05-30
I need to build a string using static text and objects holding variable text.  For example:

strCommand = "enc -d -aes-256-cbc -k " & Form1.TextBox2 & " -in ./" & Form1.TextBox1 & " -out ./" & Form1.TextBox3.Text & "Decrypted.txt"

I'm getting the following error:  Operator '&' is not defined for types 'String' and "System.Windows.Forms.Textbox'

I think it's an issue using the data in the text box.  If that is the case, what is the best method for applying the text in a text box to a variable that I can use throughout the Project and in my string?

Thanks.
0
Comment
Question by:Whah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39208999
Change this:

Form1.TextBox2

...to this:

Form1.TextBox2.Text

And this:

Form1.TextBox1

...to this:

Form1.TextBox1.Text
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question