|
Hi all
I am creating a program in which I am executing a bach file, which requires a "Enter key" hit to execute, as below :
Dim prc As New Process
With prc.StartInfo
.FileName = "e:\abc.bat" 'batchfile to execute
.UseShellExecute = False
.RedirectStandardInput = True
End With
prc.Start()
prc.StandardInput.WriteLine("{enter}")
prc.Close()
Now the above code run successfully and it appears a command prompt window showing "e:\abc.bat" file is executing but the code
prc.StandardInput.WriteLine("{enter}") is not redirecting enter key to completely execute the batch file.
How can I use "Enter key" hit on that command prompt window in vb.net.
Thanks.
Gagan
|
|
|
|
|
Lookup Console/StandardInput.ReadLine() or .ReadKey() and test for enter.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry for your suggestion but I have already tried these methods and there is no effect when a command window appears showing "abc.bat" is running.
I only want to do that when my batch file start executing, it takes a "Enter key hit" from program to completely execute my batch file(because it requires a Enter key hit for further execution)and not wait for hitting Enter mannually from user.
Suggest me how can I do that.
Thanks.
Gagan
|
|
|
|
|
Hi,
I hava piece of code which creates a networl drive on the user's system. I need to hide the network.
The purpose of doing this is that the user while using an application need to connect to the Access db on a file server. But shouldn't know that the drive is mapped onhis computer.
Thanks
Sanjeev
Sanjeev
|
|
|
|
|
I may be misunderstanding your problem but doesn't the standard Data Source parameter accept a URI - ServerMachineName\PathOnServer.mdb?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Then don't map the drive. Use the UNC path that the map points to instead.
|
|
|
|
|
I have one form in which I am searching the database table as :
cmd = New SqlCommand(" SELECT * FROM client_details WHERE DateofJoining BETWEEN #" + ddfrm + "# AND #" + ddto + "# ")
con.Open()
where, "client_details" is my database table name. And "DateofJoining" is a column.
In 2nd form, I have a datagridview, in which I have stored the data with several columns.
I want to get the number of rows from the updated datagridview in 2nd form using the filtered criteria which I did in my 1st form above.
I am trying but not able to update the datagridview using the filter.
Do i need to call any public function in 2nd form from the 1st form?
|
|
|
|
|
Yes.Make it as a Public Function in form1 and then call it from form2.
|
|
|
|
|
hi,
was wondering if it is possible to code a program to "right click" / bring up context menu for a file.
so to be a little less vague;
i have heaps of templates (win word, excel...), you right click and select "New"
which opens the respective office app with the template loaded into a fresh doc.
how could i do this programatically, rather that simply opening the file through vb or doing it manually?
apologies if this has already been answered, i have searched for it
-N
|
|
|
|
|
Right click on what?
There is an article around with global keyboard and mouse hooks I saw recently.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Yeah but you must be viewing the list of templates in something, explorer presumably!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, Friends
How I can Edit My Image In Databsae?
With Command Sql("Update Tabal Set ... ")
Thank You.
modified 3-Aug-12 18:22pm.
|
|
|
|
|
There are a number of good articles [^]in this lot.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
write a windows application that allows the user to enter a seven-digit number in a multiple line textbox when the user clicks the generate words button.
<br />
<br />
Public Class Form1<br />
Dim digits As Integer() = New Integer(6) {}<br />
Dim letters As String(,) = New String(,) {{" ", " ", " "}, _<br />
{" ", " ", " "}, {"A", "B", "C"}, {"D", "E", "F"}, _<br />
{"G", "H", "I"}, {"J", "K", "L"}, {"M", "N", "O"}, _<br />
{"P", "R", "S"}, {"T", "U", "V"}, {"W", "X", "Y"}}<br />
<br />
Dim phoneNumber As Integer<br />
Dim Number As String<br />
Dim OutPut As String<br />
<br />
<br />
Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click<br />
<br />
phoneNumber = Convert.ToInt32(Number)<br />
<br />
For i As Integer = 6 To 0 Step -1<br />
digits(i) = phoneNumber Mod 10<br />
phoneNumber \= 10<br />
' MessageBox.Show("Number = " & Str(phoneNumber))<br />
<br />
For loop1 As Integer = 0 To 2<br />
For loop2 As Integer = 0 To 2<br />
For loop3 As Integer = 0 To 2<br />
For loop4 As Integer = 0 To 2<br />
For loop5 As Integer = 0 To 2<br />
For loop6 As Integer = 0 To 2<br />
For loop7 As Integer = 0 To 2<br />
OutPut &= String.Format("{0, -10}", _<br />
letters(digits(0), loop1) & _<br />
letters(digits(1), loop2) & _<br />
letters(digits(2), loop3) & _<br />
letters(digits(3), loop4) & _<br />
letters(digits(4), loop5) & _<br />
letters(digits(5), loop6) & _<br />
letters(digits(6), loop7))<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
<br />
End Sub<br />
<br />
<br />
Private Sub PhoneNumberTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberTextBox.TextChanged<br />
Number = PhoneNumberTextBox.Text<br />
End Sub<br />
<br />
Private Sub PhoneNumberWordsListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberWordsListBox.SelectedIndexChanged<br />
OutPut = PhoneNumberWordsListBox.Text<br />
End Sub<br />
End Class<br />
but I couldn't output the words can some one help me please.
thanks
|
|
|
|
|
This looks like a mess, I don't see how you expect it to work. You have nested loops, which means each inner loop will run completely for each iteration of an outer loop. That makes sense only if you're building a list of strings that way, not outputting as you go.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'll give you a clue, to get you started.
Dim numberToWord As New Dictionary(Of Integer, string)
numberToWord.Add(0, "Zero")
numberToWord.Add(1, "One")
numberToWord.Add(2, "Two")
numberToWord.Add(3, "Three")
numberToWord.Add(4, "Four")
........
........
or since the user enters the number as text you could do it as:
Dim numberToWord As New Dictionary(Of Char, string)
numberToWord.Add("0"C, "Zero")
numberToWord.Add("1"C, "One")
numberToWord.Add("2"C, "Two")
numberToWord.Add("3"C, "Three")
numberToWord.Add("4"C, "Four")
........
........
Look up anything you don't understand on MSDN or Google it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
<br />
Partial Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Public Numbers(7, 3) As String<br />
Public Phonenumber As Integer<br />
Public output As String<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Numbers(0, 0) = "A" <br />
Numbers(0, 1) = "B" '2 <br />
Numbers(0, 2) = "C" '2 <br />
Numbers(1, 0) = "D" '3 <br />
Numbers(1, 1) = "E" '3 <br />
Numbers(1, 2) = "F" '3 <br />
Numbers(2, 0) = "G" '4 <br />
Numbers(2, 1) = "H" '4 <br />
Numbers(2, 2) = "I" '4 <br />
Numbers(3, 0) = "J" '5 <br />
Numbers(3, 1) = "K" '5 <br />
Numbers(3, 2) = "L" '5 <br />
Numbers(4, 0) = "M" '6 <br />
Numbers(4, 1) = "N" '6 <br />
Numbers(4, 2) = "O" '6 <br />
Numbers(5, 0) = "P" '7 <br />
Numbers(5, 1) = "R" '7 <br />
Numbers(5, 2) = "S" '7 <br />
Numbers(6, 0) = "T" '8 <br />
Numbers(6, 1) = "U" '8 <br />
Numbers(6, 2) = "V" '8 <br />
Numbers(7, 0) = "W" '9 <br />
Numbers(7, 1) = "X" '9 <br />
Numbers(7, 2) = "Y" '9<br />
<br />
<br />
End Sub<br />
Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click<br />
<br />
<br />
Dim phoneNumber As String = GetNumber()<br />
<br />
'check if the number contains 0 or 1<br />
While phoneNumber.Contains("0") Or phoneNumber.Contains("1")<br />
phoneNumber = GetNumber()<br />
End While<br />
<br />
'create a hashtable to hold the digits<br />
Dim arrayL As New Hashtable<br />
Dim x As Integer = 1<br />
For i As Integer = 65 To 90 Step 3<br />
arrayL.Add(x, New Char() {Chr(i), Chr(i + 1), Chr(i + 2)})<br />
x += 1<br />
Next<br />
<br />
Dim word As String = ""<br />
<br />
'creates only 3 words out of the phonenumber<br />
For i As Integer = 0 To 2<br />
<br />
For Each s As String In phoneNumber<br />
word = word & DirectCast(arrayL.Item(CInt(s)), Char())(i).ToString<br />
Next<br />
Next<br />
<br />
output = PhoneNumberWordsListBox.Text<br />
<br />
<br />
End Sub<br />
<br />
<br />
<br />
Private Sub PhoneNumberTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberTextBox.TextChanged<br />
Phonenumber = PhoneNumberTextBox.Text<br />
<br />
End Sub<br />
Private Function GetNumber() As String<br />
<br />
Return PhoneNumberTextBox.Text()<br />
End Function<br />
End Class<br />
<br />
<br />
Please help me I can't print the words in listbox
|
|
|
|
|
how to print on second page in visual page 6.0
|
|
|
|
|
i have a designed usercontrol called "bar" and i have a menu strip called "add bar" and "add note"..
when user click add bar, it will create a new "bar".
when user click on add note, it will create a panel that is create at runtime. that panel is consist of labels. now assume, at runtime, i have click "add bar" twice so it will be two "bar" but at different place.
what i want is when user click either one of it, it will be the selected one, and when user click on "add note" it will create on the selected one "bar"
i have done that. but the problem is, when i click "add note", the panel will placed at x = 0 at the selected one, thats correct, but when i selected the other usercontrol, and click "add note" it will create panel at different place, not at x = 0. it should be at x = 0, because now the selected one is the other "bar",and there is no panel yet. some one please help me.
maybe how to detect control in a panel. if there is a control than, the x will not be 0. and if there is no control, x will be 0.
thanks.
|
|
|
|
|
when you add a Control to a Container (such as a Panel), it becomes an element in myContainer.Controls, so you could enumerate, identify or count the elements in each myPanel.Controls to determine the position of any new Control you want to add.
or you could keep track of the last position used for adding something, for each Panel individually (maybe store your extra information in the Panel's Tag property). Or use a dictionary to store the relationships between Panels and extra data.
|
|
|
|
|
Hello,
I am developping with vb.net 2005 (or 2008)
I am trying to create a small phone application and get all the phone calls that I am getting at home. I would like to be able to see who is calling and at what time and date.
I success to call my modem with a cellular phone and I got succesfully info on phone number , date and time. In addition when calling, I get RING message.
The problem is when I am answering to the call through the phone through my cellular (for example), I do not get any indication that the call was answered. The same thing if I am not answering the call, I do not get any indication that it was missed call. Is your activex support those important issues?
Any idea, thank your for help
Shay Noy
|
|
|
|
|
shaynoy wrote: Is your activex support those important issues?
Who's ActiveX control?? What's it called??
The CodeProject does not supply any kind of controls. They are example projects written by individuals, so if you got a control from here, the best place to find any kind of support on it is the forum at the bottom of the article where you got the control.
Also, it would be up to the phones capabilities if this was going to work or not. You'd have to consult with the manfacturer of the phone to find out if this is even possible.
|
|
|
|
|
I am working with Rs232 class (can be downloaded from lutliple place in the internet), there are a lot of examples how to use it. But all the examples I saw do not showing the prbolem I have.
See http://www.vbinsider.com/callerid.htm[^]
Thank you
Shay Noy
|
|
|
|
|
I already told you what you have to do. Communicating with the phone is not the problem. Whether or not it will support what you want to do is.
|
|
|
|
|