Picking Up Strings From CMD Command?
Jan 29, 2010
So I've tried Process and starting a cmd.exe and send commands directly to that window. And then picking up the values written to the cmd.exe window.
The code looks like this:
Dim arrServers As ArrayList
Dim s(ListBoxServers.Items.Count) As String
ListBoxServers.Items.CopyTo(s, 0)
arrServers = New ArrayList(s)
Using P As New Process
[Code] .....
But is looks like it doesn't "press enter" or something. Meaning, I don't get any results from the command. I don't even get a "'command' is not recognized as an internal or external command, operable program or batch file." like you normally get if it doesn't understand the syntax.
View 3 Replies
ADVERTISEMENT
Feb 18, 2010
I'll start off by saying I am using Visual Studio 2008 Standard. I am creating a program that will open installed programs using short code. For instance, if a user types in 'npp' then Notepad++ opens. I have it working just fine to respond to the predefined commands, but I would like to expand it so that the user can define their own settings simply by typing the program directory and the custom short code they want: Example: If I am an end user and would like to say define a short code for Windows Media Player, I would simply type the following: (Assuming Excel or likewise is used to open the csv file).
[Code]....
View 3 Replies
Mar 7, 2011
The VB format(object,formatString) command fails when placed in the handler routines of a DataGridView.In the following procedure the newCellValue returns the Format string value instead of a formatted cell value.This pproblem occurs in both the dgv_CellFormatting and the dgv_CellClick routines.The same commands work properly when placed in a procedure on the form.
Private Sub dgv_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgv.CellFormatting
If e.FormattingApplied = False And Not e.CellStyle.Format = Nothing Then[code]...........
View 2 Replies
Dec 16, 2010
I need to open up a cmd prompt, then run a file called adb.exe which opens a shell to communicate with my android cell phone...
Heres what I need:
My Form1
Label1.Text = "adb.exe shell"
Label2.Text = "su"
Label3.Text = "mkdir /etc/folder"
[Code]....
Heres the problem... I can execute any normal dos command automaticly, but once i open the ssh prompt (adb.exe shell), i dont know how to keep putting commands in there...
The commands are stored in strings, and i need to take the commands from the strings, and type them into the command prompt like above.
View 2 Replies
Oct 16, 2009
Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 Replies
Feb 25, 2010
If e.CommandLine.Count > 0 Then
Dim IncomingCommand As String = e.CommandLine.Item(0).ToString
If IncomingCommand.Substring(0, 2) = "-1" Then
form1.close()
End If
End If
I am trying to make the program close if the -1 string is sent with the program. See my installer allows for me to run certain programs before it actually installs, but it doesn't shut down copies of the program itself. So I have a next startup instance set to shut the program down if the -1 is received. But if the program is not running it starts up instead. This is not desired. form1.close doesn't work. e.cancel = true doesn't work, etc etc. What can I do to make the program not start during this instance.
View 1 Replies
Jan 20, 2010
My vb.net browser will be the first application I'm actually pushing out to the public.Everything else so far was for me and friends or some type of class. My problem is I don't know what license to pick to release it under. It's going to be partially open source and partially not.Whats included that i didn't write or make
GeckoFx - web browser plugin like ie but based off firefox
App Life Update - http:www.kineticju...te/Default.aspx ( I have the free limited license)
Sqlite - used for bookmarks
Other than those to plugins/dll files everything else i wrote myself or followed tutorials on and modified to fit my applications need.
View 8 Replies
Apr 9, 2011
I'm using REGEX to scan the following two bits of javascript and get the stream url in the javascript codes below the regex.
REGEX:
Dim matchs As MatchCollection = New Regex("(window.SC.bufferTracks.push(){1}[^)^;]*();){1}").Matches(input)
Dim match As Match
For Each match In matchs[code].....
why it's working on one javascript, but not the other? (i've tested it on several, and it works on some and not on the others
View 4 Replies
Jun 21, 2011
value 33 in the textbox and select 0.3 in combo box it should take 33,33.1,33.2,33.3 values of outside temperature and corresponding power values to display the graph.
what i have tried till now was
con = New SqlConnection(connec string")
cmd = New SqlCommand("select TOP 50 PERCENT * from Vijay ", con)
[code].....
View 2 Replies
Feb 10, 2009
I am making a HTML editor and thats the easy par ie saving as .html etc, but i want to also add in the thing thats in VB wherein it picks up the word your typing and make suggestions, i have made it so it can have a data base of a thousand words (1000) and you can add and it loads all fine. Now i need to add in the functionallity to read every Key, i tryed
Code:
If e.KeyCode = Keys.Space Then Scan = ""
But none of this works, is there a better way of getting the the key press and adding it to a string untill space is pressed in which the array is cleared.
Code:
Imports System.IO
Public Class Form1
[code]....
So say i had a Tag stored that was "HTML" then as soon as i pressed the < key it would start checking my keys then if i pressed H it would display all word is the drop down box with H at the start then if i followed it with T then M it would show HTML in the box and maby a couple of others that began with HTM, if i then hit enter it would add in the L> thus compleating it and printing "<HTML>"
View 7 Replies
Aug 3, 2010
I'm just wondering if its even possible and if there is a code out there that can do this:
[Code]...
View 4 Replies
May 15, 2012
We use some software at work called nicelabel, which prints out box end labels by dragging data from a database. We currently have two templates that we use, one for jpgs and one for bmps. For example this is the code that is ran on the picture on our box end label -
[Code]....
Now, if the relevant image in the folder is a .bmp, the process will fail and no image will be assigned to the box end label. Vice versa with if we run the .bmp version of that code and it's a .jpg. Is there any way we can modify that script to say .jpg OR .bmp, picking whichever it is? For example, look for this file with a .jpg at the end, if you cant find it look for this file with a .bmp instead?
View 6 Replies
Nov 20, 2011
The following code doesn't work;[code]....
View 17 Replies
Sep 24, 2009
When working with the code within a control's subprocedure if you type it brings up intellisense as you would expect: Code: sender. Within the intellisense there is no text property listed to select from however if you just type "text" after the "sender." it allows it. It also doesn't capatilize the T in text after you leave the line as you would expect to see when working with other properties. This is the first occurence that I've seen where an item was not included in intellisense but allowed it without errors. This is a big code saver and discovery for me as it cuts my other previous methods of extracting the control's text down to a single simple line.
View 2 Replies
Jan 27, 2010
In our VB.net coding project, we have a module with the code shown below. In our frmMain.vb, we use every thing you see in the modeul.
However, when happily coding along, intellisense doesn't seem to see these or pick them up.
How can we change this so Visual Studio's Intellisense picks up our constants? For example, when typing:
If System.IO.File.Exists(SERVERS_CONFIGURATION_FILES) Then
I want to be able to type something and then the dot, such as Me.whatever and have it picked up. Below is our module:
Module ConstantsAndEnums
Public Const PROGRAM_NAME As String = "Server Monitor .NET"
Public Const TOOLTIP_BUBBLE_DISPLAY_TIME As Integer = 10000
[Code].....
View 6 Replies
Feb 3, 2010
i have created a table with 2 fields in vb.net as follows -
[Code]....
How do i put a hyperlink on the name cell, so when i click on a specific name it will goto next page with that name?
View 2 Replies
Jun 6, 2009
trying to finish up some odds and ends of a game I am making.I have 9 picture boxes, and after the user picks one, i want the computer to randomly pick another, then the user and so on until all 9 boxes are full.This is what I have so far. It will let the user click a box with one character, then the user has to click another box and it fills it with the other character, but instead of the user having to click the second time, i want it to be automatically filled, unless it is already filled.
[Code]...
View 2 Replies
Dec 6, 2011
I have just opened VB10 for the first time and it converted my VB8 program beautifully, except that all of the screens are not showing any data !
My reference to the MS Access database file is as follows :-
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MoneyMoney.mdb"
Do I need to change any of this syntax or is there some other reason why VB10 won't show anything ?
View 19 Replies
Oct 6, 2011
I'm trying to figure out how to make a number be randomly picked but only picked once when a button is clicked. I've got the simple random number code down already but I can't seem to figure out how to have it picked only once.This is basic random code that I'm using right now.
Randomize()
Dim value As Integer = CInt(Int((14 * Rnd()) + 1))
It picks out a number from 1 to 14 and returns it as an integer in "value", and I'm using to set that to open a specific form but I don't want that specific form to open more than once in a session. So if the number three was already picked out then it could never be returned ever again.
View 2 Replies
Sep 28, 2009
I'm using the following code to work out the next unique Order Number in an access database. ServerDB is a "System.Data.OleDb.OleDbConnection"
Dim command As New OleDb.OleDbCommand("", serverDB)
command.CommandText = "SELECT max (ORDERNO) FROM WORKORDR"
iOrder = command.ExecuteScalar()
NewOrderNo = (iOrder + 1)
If I subsequently create a WORKORDR (using a different DB connection), the code will not pick up the new "next order number."e.g.
iFoo = NewOrderNo
CreateNewWorkOrderWithNumber(iFoo)
iFoo2 = NewOrderNo
will return the same value to both iFoo and iFoo2. If I Close and then reopen serverDB, as part of the "NewOrderNo" function, then it works. iFoo and iFoo2 will be correct. Is there any way to force a "System.Data.OleDb.OleDbConnection" to refresh the database in this situation without closing and reopening the connection. e.g. Is there anything equivalent to serverdb.refresh or serverdb.FlushCache
How I create the order.I wondered if this could be caused by not updating my transactions after creating the order. I'm using an XSD for the order creation, and the code I use to create the record is ...
Sub CreateNewWorkOrderWithNumber(ByVal iNewOrder As Integer)
Dim OrderDS As New CNC
Dim OrderAdapter As New CNCTableAdapters.WORKORDRTableAdapter
[code]....
View 2 Replies
Dec 30, 2011
I am overriding the WndProc to capture the WM_VSCROLL of a textbox / RTB... However this does not seem to capture the scroll event if it happens from a scroll wheel of a mouse ... how can i pick this up?... i can't use the MouseWheel event because this occurs when the mouse is scroll wheel is actually turned and not after the content is actually scrolled.
View 7 Replies
Sep 21, 2011
how to go about picking the random weapons. When you generate a random class, the user must first enter their current rank (level). This is because you are unable to use certain guns until you reach a specified level. This keeps the program from giving out guns the user can't use. What I am doing is allowing the user to give certain parameters as to what type of gun they want to use (or don't want to use). For example, I have checkboxes for the user to pick if they want assault rifles, SMGs, LMGs, Snipers, Shotguns, RPG, etc.
I did this in another version of this program I made, but the only option was to pick whether or not you wanted RPGs included. So, it was easy enough to check if the weapon was an RPG and if it was simply generate another random weapon. I could do this, but with the number of options there are, I don't think this would be the best solution.
[Code]...
View 2 Replies
Apr 30, 2010
First let me say that I am not sure whether or not this should go in this section or the API section, and if it needs to be moved I apologize. My issue is fairly straight forward, but for some reason I cannot get it to work.
I am trying to send a command to a command line and then submit the command. I have been trying without success to get this to work in v2008 Express and v2010 Express, Here is the code I am trying to us:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
[Code].....
View 6 Replies
Feb 3, 2011
I have an MDI form on which I have placed a ToolStripContainer. I have set the BackColor of the toolstripcontainer.contentpanel to an ApplicationsSettings property binding for BackColor. At design time the background colour of the contentpanel reflects the colour in the saved Applications Settings. However at run-time the background colour of the content panel is not the colour that has been saved in the applications settings (in this case DarkSeaGreen). It continues to display the colour from the current
View 2 Replies
Aug 13, 2009
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 Replies
Aug 5, 2010
I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
View 5 Replies
Oct 16, 2009
I'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
View 3 Replies
Oct 11, 2011
I wrote windows app to upload files to different FTP sites by picking the files from different folders.A log is displayed by appending text to the textbox at every step.Textbox is ReadOnly.
Issue:When app is loading a bf file to FTP and if user tries to scroll the textbox,the form is hanging and going to Not Responding.?
View 4 Replies
Aug 15, 2011
I have been looking for examples to find the string between two strings. This top one works fine;
Public Sub ReadData(ByRef keywordStart As String, ByRef keywordEnd As String, ByVal filename As String)
Using reader = New StreamReader(filename)
[Code].....
Now the first one is fine - Ext_Volume is result of the string between the strings <Volume> and </Volume>. <Volume> and </Volume> are unique so this is straight forward.
However the second one - "^FDExp:" is unique, but "^FS" is not unique. There are occurances of "^FS" before and after "^FDExp:".
How do I get the string to search AFTER the occurrence, not before etc?
View 5 Replies
Jun 24, 2011
Dim str As String
Dim str2 As Array
str = "blabla duhduh"
str2 = str.Split(" ")
View 2 Replies