|
jhoga wrote: Come on now read documentation? Who does that?
Real people.
jhoga wrote: the pressure of an angry ap clerk
Well, let's see the angry ap clerk do a better job, which I doubt
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Luc Pattyn wrote: Did you care looking at the documentation of the classes you use?
He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: He obviously didn't and can't believe the attitude he gave you in his reply about reading documentation.
Did you get that he was poking fun at himself in his reply?
Did you see the "Red face" emoticon?
He wasn't giving any attitude. He was saying "Doh!".
|
|
|
|
|
RCoate wrote: Did you get that he was poking fun at himself in his reply?
Looking back at it, yes.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
strRead.Read reads the first character of every line.
do while not str.Read.EndOfStream
...
loop
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
i have winservice project. call a method to append to a fire at 60 second interval. i notice that it append twice and student. if i insert to data base it inserts one do the sevice is still runnin
|
|
|
|
|
Hi,
When I run a DOS command line program it will work on a file that is located in the root of C:\ but if I try to run it on a file on my desktop nothing happens. Is there any way to get this to work.
|
|
|
|
|
Try this
Process.Start("cmd")
Vote the answer if it is helpful
|
|
|
|
|
This is the code I am using
'myProcess.StartInfo.FileName = "C:\Program Files\PDFcheck\pdffonts.exe " 'Full pathname to including file name
'myProcess.StartInfo.Arguments = filename ' If the program takes args as string
'myProcess.StartInfo.CreateNoWindow = True ' Does not create a window DOS program
'myProcess.StartInfo.UseShellExecute = False ' Must be false to redirect output
'myProcess.StartInfo.RedirectStandardOutput = True
'myProcess.Start() ' Start the DOS program
'myProcess.WaitForExit() ' Wait until it completes before moving on
'prgOutput = myProcess.StandardOutput.ReadToEnd ' Get the DOS output
'pdffonts = prgOutput
'f.Close()
|
|
|
|
|
include the full path to your program.
Greetings from Germany
|
|
|
|
|
Could it be that the filepath you are supplying contains spaces? If it is a dos program, they generally don't support spaces within filenames, and "c:\documents and settings\user\desktop" does contain spaces. You could try:
c:\docume~1\user\desktop\filename.ext to see if this is the problem.
|
|
|
|
|
is there a way to convert the path from the standard to the dos path version within vb.net
|
|
|
|
|
you can go here:
http://bytes.com/forum/thread349072.html[^]
or copy/paste
Private Declare Auto Function GetShortPathName Lib "kernel32" (ByVal lpszLongPath As String, ByVal lpszShortPath As System.Text.StringBuilder, ByVal cchBuffer As Integer) As Integer
Private Const MAX_PATH As Integer = 260
Public Function ShortFileName(ByVal LongFileName As String) As String
Dim ShortPath As New System.Text.StringBuilder(MAX_PATH)
Dim BufferSize As Integer = GetShortPathName(LongFileName, ShortPath, ShortPath.Capacity)
Return ShortPath.ToString
End Function
|
|
|
|
|
Perfect. Thanks a million for your help.
|
|
|
|
|
Ignore everything you've just been told. Though, Jasey9 got it partially correct and his solution is technically correct, but completely unnecessary.
You have to enclose the full path of the file your passing to the DOS app in double quotes. Something like this:
someApp.exe "C:\Documents and Settings\userName\Desktop\Some Folder\File.txt"
What your code is doing is passing this:
someApp.exe C:\Documents and Settings\userName\Desktop\Some Folder\File.txt
Notice that there are no quotes. Since command line arguments are parsed using the "space" character as a delimiter, you've actually passed 4 arguments to the app, not 1. Enclosing any item, not necessarily path names, in double quotes treats the contents of the quotes as a single argument.
So, in your code, you have to add double quotes to both ends of the path that your passing in the Arguments property of your Process object.
Public Shared Function FixupCommandlineParameter(ByVal s As String) As String
Return String.Format("""{0}""", s)
End Function
myProcess.StartInfo.Arguments = FixupCommandlineParameter(filename)
|
|
|
|
|
|
Hi,
Is it possible or how do you create a exe that when you drop a file onto it, the program will run and do a task on the file that your dragged onto it.
|
|
|
|
|
When you drag a file over an exe (or shortcut), the program will be started with the filename as a command line argument. You can either change Sub Main() to Sub Main(args() As String) or find some other way to get the command line arguments (System.Environment.GetCommandLineArgs(), for example).
Something similar happens if you associate a file type with your program and double-click the file in explorer.
|
|
|
|
|
I will try explain what I am trying to do a little better than before. I have a program that when you run it the Open FIle Dialog appears so you can select a pdf to run a check on. What I want to do is to allow the user to drag and drop the pdf onto the exe an instead of opening the Open File dialog it would bypass it but still use the file name and path that I have selected as the file to check. An example of this would be if you create a text file on your desktop. You can then drag and drop the file on Notepad.exe and the file will open straight away.
modified on Thursday, July 3, 2008 10:46 AM
|
|
|
|
|
Gideon provided you with the answer you need
When you drop a file onto you'r exe, the exe will start with in its arguments the path to that file
like gideon said you can then eighter change the constructor of you'r startupform form
public sub new()
to
public sub new(args() as string)
or use System.Environment.GetCommandLineArgs() to get the arguments passed to the exe
this is a standerd function in windows (drop any file onto (olmost) any exe and the exe will start)
But all this has been said by Gideon so...
|
|
|
|
|
I haven't done that myself, but this article has a basic tutorial that should point you in the right direction. The main events here seem to be DragEnter and DragDrop.
|
|
|
|
|
sorry for posting second question on same topic becouse second is for display data is posted by mistake and try to modify in edit mode thats is not shown ,
'this code is worked
isql="Insert Into students(id, first_name, last_name, major,current_credits) values (?, ?, ?, ?, ?)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add("id", id.Text)
idbcomm.Parameters.Add("fname", fname.text)
idbcomm.Parameters.Add("lname", lname.Text)
idbcomm.Parameters.Add("major", major.Text)
idbcomm.Parameters.Add("credits", credits.Text)
idbcomm.ExecuteNonQuery()
'This code is not working reports error
'lsSQL ="Insert Into stud(id,firstname,lastname,major) values (@id,@fname,@lname,@major)"
'idbcomm=new odbccommand(isql,dbconn)
'idbcomm.Parameters.Add( "@id",id.Text)
'idbcomm.Parameters.Add( "@fname",fname.text)
'idbcomm.Parameters.Add( "@lname",lname.Text)
'idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()
sanjeev
|
|
|
|
|
Please Check your data type against your Variable data.
and why you use Paramenters. It is meaning less.
Anubhava
|
|
|
|
|
idsanjeevjha wrote: 'This code is not working reports error
What is the error ? You have use @ symbol for parameter. I believe you should use ? symbol for parameters in Odbc.
|
|
|
|
|
i am getting ERROR [42000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00936: missing expression.
ya i have to use ? symbol for parameter in odbce but why @ is used in sql or msaccess
thanks
sanjeev
|
|
|
|