VS 2008 Calling Cmd.exe And Writing To It?
Nov 3, 2010Do not care to stay at these forums when criticized by other members.
View 6 RepliesDo not care to stay at these forums when criticized by other members.
View 6 Repliesi'm running Visual Basic 2008 Express Edition (latest service pack ... 9.0.30729.1 SP) on XP Pro SP3 with .Net Framework version 3.5 SP1 I have a rather large project I've imported from Visual Studio 2003 (Standard).The project compiles and runs just fine ... my compiled program itself never crashes.
But while I actually have the code up in the IDE, and simply adding/deleting code the whole IDE will randomly crash (usually without warning) and I loose my changes since last save.If/when I do get some hint of why it crashed, I get a window about illegal whitespace or something.... but that's rare ... usually it just crashes without warning and the whole IDE completely shuts down instantly. just deleting/adding a character is enough to trigger it maybe once every 30 minutes.
This is on a computer that is otherwise very rock solid .... no other program ever crashes, etc.
I am using Visual Studio 2008 to try and create a calculator program that can convert binary to decimal. I have some code but I'm having problems figuring out what to write as an "argument" when I was to call the function.
Here is the code I have so far.
Public Class Form1
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
[Code]....
I have created a .NET assembly, clicked 'Register for COM Interop' on the properties page, strongly named it and compiled it. Then I GAC'd the .NET DLL manually. Calling the .NET assembly from my VB6 code with 'CreateObject("MyNETProject.class1")' gives me an automation error. I've gone through about 3 iterations of this for most of the day and cannot sort out what I'm doing wrong. I have a feeling it's got to do with my .NET assembly settings and GACing but it all seems right.
View 3 RepliesI am very close to finishing this function, what I am trying to do is a for loop which:
1) Grabs the value
2) saves the value in an .xml file for later use
Currently when I use a for loop to feed in my function I overwrite the hiddenFields.xml on every pass, instead of adding to it.
Calling function:
vb.net
For X As Integer = 0 To postingHiddenFields
Dim hiddenFieldsReturned As String = functionDealWithHiddenFields(HTMLResponse, postingHiddenFields, X)
Next
[Code] .....
So basically on every pass of the function I'm overwriting the values instead of adding to them.
Ive searched for the pass hour on how to do this. Everything ive found is for vb6 and it wont work with 08 for some reason. Here is what i am doing, and the way i want to do it.I have a login form that has a checkbox remember me. Inside the if statement (If chkRemember.Checked = true) I want the code to write the username and password in a config.ini file in this format;
[LoginInfo]
Callsign=dsfsdf
Password=dsfdsf
[GeneralInfo]
Can someone provide me with a code i can use for this? I also want to be able to read that data to.
I tried the 2 listed answers to this problem but neither worked.I'm writing with VB 2008 Express under .net 3.5 Project going well - no problems until I needed to change the form design again. The project still runs OK - the "Form1.vb" and "Form1.Designer" files are still there and look OK, BUT the "Form1[design]" tab is missing - how do I get it back?
View 2 Replieswith access 07 + vb.net...i am calling an access Query ....the Query which uses a user defined PUBLIC function in access module...the problem is i am getting an error as "Undefined function 'DecideSON' in expression." in fact DecideSON is a function in the access database module?
View 2 Repliesim in need of calling a function in another process, now from the last couple hours of digging ive found out that i need to use createremotethread for that, problem is - it has a bunch of parameters i dont know how to fill, especially the address part. I tried using getprocaccess and getmodulehandle for that but i dont think they return what i need.
View 9 RepliesI have 2 forms FORM 1 and 2 i got this code in form 1
vb.net
Private Sub starauto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles starauto.Click
form2.Button1.Value = True
form2.Button1_Click()
End Sub
but both examples give me an error
error 1.- 'Value' is not a member of 'System.Windows.Forms.Button'.C:Documents and SettingsleijaiMy DocumentsVisual Studio 2008ProjectsIp On or OffIp On or Offform1.vb239Ip On or Off
Error 2.- Error3Argument not specified for parameter 'sender' of 'Public Sub Button1_Click(sender As Object, e As System.EventArgs)'.C:Documents and SettingsleijaiMy DocumentsVisual Studio 2008ProjectsIp On or OffIp On or Offform1.vb249Ip On or Off
error 3.- Error2Argument not specified for parameter 'e' of 'Public Sub Button1_Click(sender As Object, e As System.EventArgs)'.C:Documents and SettingsleijaiMy DocumentsVisual Studio 2008ProjectsIp On or OffIp On or Offform1.vb249Ip On or Off
i am trying to use a login form that is used to login after you select one of 7 forms. this login form calls a function that validates then it calls another function, if it's true, that will load the appropriate form.
here's what i have.
vb.net
'Here are the appropriate variables
Public FormName As Form
[Code].....
Is is possible to do something like:TextBox1.Text = Replace(TextBox1.Text, ".*", "", 1, , CompareMethod.Text)
View 9 RepliesIs there a way to call or pass a variable to another sub? I'm trying to reterive a variable (or even a field name) in somethign like this:
Private Sub PrintPageHandler(ByVal sender As Object, ByVal args As Printing.PrintPageEventArgs)
args.Graphics.DrawString(RS("field1"), New Font("arial", 8), Brushes.Black, 5, 5)
[Code].....
how should I go about starting to create a Win32 application interface to help user register an account from a website.The website have a form with a lot of controls which is not mandatory field, so my task is to create a form with a few controls and submit to the web server.What is the method that I should read about, is it HTTP Post/Get related thingy or is there any sample on how can I communicate the form action?
View 2 RepliesIf certain conditions are met within a given subroutine, I would like to execute two other subroutines. Note that the other subroutines I want to call/execute "handle" a lot of events
vb
Private Sub S2_Enter (ByVal sender As Object, ByVal e As System.EventArgs) Handles S2.Enter
If upltschanged = True Then
[Code]....
Okay, I have a structure that contains numerous elements... mostly strings, one or two integers. I maintain an internal array of that structure. The structure contains ONLY data elements, no code.I want to save the data to a file. I know that I CAN use StreamWriter.Writeline()to put out a formatted string for each element in the array. But is there any way to simply open a binary output file and save each structure, one after the other? And conversely, to load the array again in similar fashion? Something similar to this in intent, though I realize the code below doesn't work.
[code]...
To repeat, I want to write an entire structure to a datafile quickly and easily, without having to save each member of each element in the array. And conversely, to read the data back in the same way for easy loading of the array.
"An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll" when writing to registryI write to the registry quite often in my program (Around 10 times every 12 seconds) the error doesnt constantly pop up sometimes it can save 20times and on 21st ill get the above error. How can i fix this. Is it because im saving so often?
View 8 RepliesOk so there is an XML file for a program that already exists that stores a list of files along with other information.I need to open this file and read the file names and then potentially add files to it if they DO NOT already exist in the file.It is very important that I not wipe the XML file and have to write it from scratch every time.
View 4 RepliesI'm trying to read 5 bytes from a file and then do something according to what has been read. This is my code (I'll explain in a bit what's wrong):[code...]
It reads the 5 bytes I added to the encrypted file, but I want the CryptoStream to start from the sixth value and then copy the original bytes into the decrypted file, but it gives me an error:
Padding is invalid and cannot be removed.That's why I'm trying to make it read from the sixth value and then continue copying normally, but I'm stuck.
I'm currently doing a project, I have 5 text boxes, and the information I put inside them get's added to a record in my database..In this record, an auto-number is allocated, and I need to display what the auto-number allocated is..
View 7 RepliesI am coming across a lot of odd and annoying problems in this program and have almost had enough lol.
I cannot figure this one out for the life of me. I have used streamwriter a hell of alot of times and never once experienced this. But basically I have a string array and I need to write the entire array to a text file with a new line for each array item. So I have gone ahead and done this:
[Code]...
However the outcome is the text file only contains 1 line and that line is the last item in the array yet I know the array has got at least 50 items in it.
I found the following links to fill a listview and then write it to a CSV.[URL]..And I modified the codes and created the project which is attached to this post.
The project works OK but my only problem is that when it creates the CSV file, columns are not created in excel. For example if I expect the data to be placed in A1, B1 and C1 cells, the data will all be placed in A1.
I have a structure in memory which is working fine - now I need to write this entire structure to a file. The below code almost compiles, the problem is that "mstaRecordInfo" cannot be changed to a string, probably because of the Date field. I've just spent over an hour experimenting and searching the web but have gotten no closer to a solution.
[Code]...
This time i have a RTB (look.text) that contains no more than 12 lines (it updates according to a listbox but it will never exceed 12 lines of text). The lines contain numbers like this:2345,0,0,1,36,... and the last line will always be a number like: + or -123456789I also have 12 textboxes (a0.text to a11.text). How do i write each line from the RTB in a textbox?-i can't show you my code because it looks stupid and no matter what i tried i always ended up getting the same error "Index was outside the bounds of the array"-
View 4 RepliesFor writing to a Text file and saving it somewhere like my C: drive, Should the following work?
Dim 1 As NewStreamWriter ("C: est.txt")
I want to put this code into the On btn click section so it outputs the content of my listbox into a .txt file ready for printing if needed
I'm writing to console and it seems to work well. I'm using this
AttachConsole(-1)
Console.Out.WriteLine("Hellow world")
FreeConsole()
The question is:
If I run the app's exe file from command line, and try to redirect the output into a file. It doesn't work.For example:C: > myapp.exe > c:output.txt I still get the output to console screen, but I want to to be saved into output.txt What's going wrong ? How to do that?
im trying to write a .reg file out that is written into the exe's my.resources dynamically at compile time from a diffrent app... but the .reg file gets messed up and alot of extra txt gets added ...
[Code].....
im having an issue writing to an access database via vb.net 2008 i can read form it but not write?
View 4 Replieswriting a text file, If LineData(1) = "ABCDE" then I need the file to look like this when the text file is opened:$mov "ABCD" D10 No other quotes or spaces are allowed. Now I have opening and closing quotes on the entire line no quotes on the ABCD section
DRegister = 10
FileName = "C:PLC Print2.txt"
FileOpen(ff, FileName, OpenMode.Output)
For K = 1 To I
[code]....
i have a richtextbox with which has an image , i want to write on the image because now if i go to write , it writes after the image
View 26 Replies