|
An application has two textboxes on it, on positioned above the other. As each character is entered into the upper textbox, the string that has been entered into the upper textbox must appear in the lower textbox, but in reverse. WOW, HOW WOULD THAT CODE LOOK LIKE, ANYBODY HAS ANY EXAMPLES.
BUT IF THATS NOT ENOUGH THEN...If the input field contains any digits (0 through 9), each such digit must be translated into its corresponding English name reading in correct left-to-right order, followed by a space character. For example, if the string that has been entered into the upper textbox is “abc123def” the string displayed in the lower textbox must be “fedThree Two One cba”. HOW CAN I DO THIS WITHOUT THE USE OFANY STRING REVERSAL FUNCTIONS... ANY EXAMPLES WOULD SURE BE APPRECIATED.
THANKS
|
|
|
|
|
Sounds like a pretty standard homework assignment. When you're doing your own homework, if you get stuck, feel free to ask for help here. Generally, this site is great if you're willing to try it for yourself, and post some code/meaningful questions when you get stuck.
Things don't often end well when people ask for a stranger to do their homework for them.
MotorMaxDrive wrote: HOW CAN I DO THIS WITHOUT THE USE OFANY STRING REVERSAL FUNCTIONS
Well, you need a string reversal function, I suspect what your teacher means is that you need to write your own, any APIs that do this would miss the point ( which is for you to learn something )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
In addition to what Christian said, a helpful pointer in solving this is to think about it in 2 sections. Often larger projects need to be cut down into managable pieces.
1) A system to reverse a string directly. enter "abc" and its outputs "cba"
2) A system to turn numerical entry into their associated words (1=one, 2=two)
These two sections can then be combined (probably by a third class) to fuflil the overall goal.
|
|
|
|
|
For Each foundfile As String In System.IO.Directory.GetFiles("E:\StockTestData")
lstDisplay.Items.Add(foundfile)
Next
The above code reads the directory stocktestdata and then prints all the file names with the directory information to a listbox.
What I would like it to do is add just the file names to an array (just the file names without the directory info).
Anyone have any reading?
Thanks.
George
|
|
|
|
|
Path.GetFilename is what you need to get just the filename from each foundfile.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Let say I've got a class MyGenericClass(Of T). This class contains a property GenericProperty(Of T).
I further got a class MyClass.
Let's create an instance of the generic class:
Dim genericInstance as New MyGenericClass(Of MyClass)
and fill the property with an instance of MyClass:
Dim myInstanceOfSomething as New MyClass
genericInstance.GenericProperty=myInstanceOfSomething
Now I got a non generic function (I can't use a generic function for certain reasons):
Public Function MyFunction(ByRef input as Object) as Object
Within this function I want to "unwrap" the "property object" and return it like
Dim myUnwrappedProperty as Object = MyFunction(ByRef input as Object)
Now I could find out the type of myUnwrappedProperty by reflection and cast it back to MyClass.
MyClass is just a "placeholder" and could be always different (if necessary I could derive all of them from one base class or implement an interface)!
I need a real reference to myInstanceOfSomething because I want to add an event handler to it!
Any idea out there?
Thankz in advance!
|
|
|
|
|
I have a web service that feeds my Windows application when the network is down and for the life of me, I can't get this damn thing to work. Error:
<br />
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).<br />
error CS2001: Source file 'C:\WINNT\TEMP\-7n_vwzf.0.cs' could not be found<br />
error CS2008: No inputs specified<br />
<br />
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)<br />
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies)<br />
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)<br />
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence)<br />
at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)<br />
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()<br />
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)<br />
--- End of inner exception stack trace ---<br />
I'm not sure on what to post to get the answers I need. This is my first attempt with web services.
Any and all help will be greatly appreciated
|
|
|
|
|
One of ASP.NET's little quirks, you need to give the ASP.NET Machine Account (Usually ASPNET) write access to the Temp folder in the Windows directory.
I believe it needs this to compile classes used for serialising the SOAP requests.
|
|
|
|
|
OUT STANDING !
I thought I'd _crew'd it up. That work perfect. Thank you.
|
|
|
|
|
Hi! Please help with this issue:
I have sqlDataSource DS (used for bring data to dropdownlist) and I want to use
InsertCommand for executing parametrized SQL.
DS.InsertCommandType = SqlDataSourceCommandType.Text
DS.InsertCommand = "insert into jtest(test_text) values (@mnf_text)"
DS.InsertParameters.Add("@mnf_text", DropDownList1.SelectedItem.ToString.Trim)
DS.Insert()
works fine!
If I want to use stored Procedure mode, it doesnt work with parameters, may be,
I guess, in this case order of params is important and not a name.
DS.InsertCommandType = SqlDataSourceCommandType.StoredProcedure
DS.InsertCommand = "insert_proc"
DS.InsertParameters.Add("@mnf_text", DropDownList1.SelectedItem.ToString.Trim)
DS.Insert()
Doesnt work!
|
|
|
|
|
My current situation is that I have a program that opens a form for processing, while the menu/main screen of the program is still open. On the main screen i have a menulist that contains shortcut keys for items on the menu. I was wondering if it was possible to be able to override those shortcut keys, and assign those same shortcut keys to buttons on the form that is opened for processing. I tried messing around with the keyDown property but it doesn't get fired before the previous shortcut key (on the main load screen)
Thanks in advance.
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Hi,
Is there any open source vb 6 code to convert TIFF images to GIF or Jpeg
|
|
|
|
|
VB6 plain cannot do that. GDI+ can, if you can control it in VB6, or if you write a COM dll in C++ that uses GDI+ to do it for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Why not load image-magick (I think thats how it is spelt) you can call it by launching the process and controlling the IO devx has a great article on launching and controlling processes.
|
|
|
|
|
I have the following code but the exception occurs : System Failure sending message. What should i do, the code is:
Imports System
Imports System.Net.Mail
Public Module Module2
Sub Main()
Dim EmailTo As String 'Emailaddres for user to send
Dim EmailFrom As String 'Emailaddres for user from
Dim MailSubject As String 'Subject of Mail
Dim MessageBody As String 'Message
Dim ServerName As String 'Server Name - important
'Add in EmailTo, EmailFrom etc parameters here
EmailTo = "<email to>"
EmailFrom = "<email from>"
MailSubject = "<Subject Line>"
MessageBody = "<This is the email>"
ServerName = "<servername>"
'Set the SMTP Server's address
Dim myClient As New smtpClient(ServerName)
'Enclosed within Try-Catch block to catch exceptions in case of errors
Try
myClient.Send (EmailFrom, EmailTo, MailSubject, MessageBody)
Catch ex As Exception
MsgBox ( "Delivery Failure: " & ex.Source &" for " & ex.Message )
End Try
End Sub
End Module
Thank you.
Khurum
|
|
|
|
|
I came here to post a question about email myself. From what little I have learned about it so far, I would check the Send() function to see what it expects for arguments. If they are all strings then I have no idea, but if some of them are supposed to be objects maybe a string is not a valid substitue for that type of object. For example, EmailTo may be an array or object capable of containing multiple addressees.
>>>-----> MikeO
|
|
|
|
|
Here is an example of what a working email sub looks like:
Dim objMail As New System.Net.Mail.MailMessage
Dim ToAdd As New System.Net.Mail.MailAddress("to@email.com", "Recipient Name")
Dim FromAdd As New System.Net.Mail.MailAddress("from@email.COM", "Sender Name")
'The subject of the message
objMail.Subject = "Request for Mathching Funds Grant"
' The message text
objMail.Body = "Body Message Here"
objMail = New System.Net.Mail.MailMessage(FromAdd, ToAdd)
'Add a carbon copy recipient.
'MailAddress copy = new MailAddress("Notification_List@contoso.com");
'message.CC.Add(copy);
'Set up the client
Dim objClient As New System.Net.Mail.SmtpClient
objClient.Host = "smtp.host.com"
objClient.Send(objMail)
Sorry i'm too tired to dissect your code, but this code should get you on the right path
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Thanks very much for your help.
I tried running your code with the relevent details changed; to/from addresses and the exchange server name(smtp.server.com).
However the code runs but no emails are received.
I have an exchange environment, and am new to programming, what can i do??
Cheers
Khurum
|
|
|
|
|
What I want to do is look at a file on a remote computer and get it's Product Version (not file version).
The code that I'm using to get this is:
productVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo("\\" & compName & "\C$\Progra~1\Mozill~1\firefox.exe").ProductVersion
This works fine if I'm logged in with my Domain Admin account. But I want to be logged in as a user instead of an admin. How do I send my Domain Admin credentials along with the file info request?
In this specific instance, the Product Version isn't located in the registry or (as far as I can tell) in anything that WMI can report. I know how to pass credentials when accessing remote WMIs, just not with file system requests.
Been stuck on this problem for over a week. Please help.
Thank you,
Chris
|
|
|
|
|
I am working on a Finger Print terminal's PC connectivity software. I am using an OCX provided by the hardware manufacturer. Till now I am able to connect to the device and read user IDs. But the problem is with reading finger print data from the device and converting it to bitmap or any other image format. Manufacturers have provided a sample application in Delphi. I am created the similar VB application by understanding its different function. A function in which the data is being read from the device is -
function TForm1.BackupFinger():integer;<br />
var<br />
bRet:boolean;<br />
iRet:integer;<br />
jh:integer;<br />
dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber:integer;<br />
d1,d3:longint;<br />
buf: array[0..800] of longint;<br />
m:TMemoryStream;<br />
begin<br />
jh := StrToInt(cbJh.Text);<br />
d1 := 0;<br />
d3 := 0;<br />
dwMachineNumber := jh;<br />
dwEnrollNumber := qfp.FieldByName('dwEnrollNumber').Value;<br />
dwEMachineNumber := qfp.FieldByName('dwEMachineNumber').Value;<br />
dwBackupNumber := qfp.FieldByName('dwBackupNumber').Value;<br />
bRet := FPKeeper1.GetEnrollDataB(dwMachineNumber,dwEnrollNumber,dwEMachineNumber,dwBackupNumber,d1,buf[0],d3);<br />
if bRet = true then<br />
begin<br />
m := TMemoryStream.Create;<br />
m.Position := 0;<br />
iRet := m.Write(buf,800);<br />
qfp.Edit();<br />
qfpdwEnrollData.LoadFromStream(m);<br />
qfp.FieldByName('dwPassWord').Value := d3;<br />
qfp.FieldByName('Memo').Value := 'Backuped';<br />
qfp.Post();<br />
m.Free;<br />
BackupFinger := 1;<br />
end<br />
else<br />
begin<br />
BackupFinger := 0;<br />
end<br />
end;
Its obvious that data is being read and stored in Access Database. Now, I don't know what type in VB I should create for TMemoryStream. Also any idea how to convert this data into any image format will be very helpful.
|
|
|
|
|
Hi,
Please how do set papersize irrespective of printer type.
And also I want to set the endof the document such that if a paper of double the papersize is set on the print 2 copies will printed on the paper.
When shld I use the Newpage method.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
Hi to all you coders out there
I'm relatively new to all this and I'm presently using Visual Studio 2005 with VB.NET and ASP.NET. I'm designign a web application using ASP.NET.
Hopefully what I'm asking is simple (just not to me!). I want some sample VB.NET code to print an exisintg document to a specific printer. I know this has changed alot from VB 6 which I had used before. In the example take the following parameters:
document name and path: C:\Upload\report.pdf
printer name: OfficeJet85
I really hope to hear from some of you! Thanks in advance!
Dave
|
|
|
|
|
I don't believe you can start a printer in ASP.NET, the user has to do it in the browser.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian
Thanks for your reply.
Can I do it using VB.NET?
Dave
|
|
|
|