|
Shell("7zr a -mx9 " & """" & x & ".7z" & """" & " " & """" & x & ".ecm")
"7zr a -mx9 " is the call to your program, the space after the 9 is to get ready for the first parm.
& """" concats a double quote
& x concats your variable file name
& ".7z" concats the extension
& """" concats a double quote
& " " concats a space to get ready for the next parm
& """" concats a double quote
& x concats your variable file name
& ".ecm" concats the extension
So...looks like I forgot to put the last quote in... you need one more of these:
& """" for the last double quote.
When your x variable is set to My File ...this would be the output:
7zr a -mx9 "My File.7z" "My File.ecm"
|
|
|
|
|
thanks Now i Figured it out.
|
|
|
|
|
The Shell statement is deprectated and is only there for backward compatibility of upgraded VB6 code. Use the Process class instead.
|
|
|
|
|
Do you mean diagnostics.process.start ?
But that doesn't wait for process to finish.
|
|
|
|
|
Striker.dbz wrote: that doesn't wait for process to finish
That must have been an excellent reason for coming up with an entire class; lots of useful methods are available.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Did you bother to read the documentation on the Process class or even look through the Intellisense list after you typed Process. ?? Maybe that WaitForExit method might be useful for something...
|
|
|
|
|
Can you please elaborate i am very new to programming?
Thanks.
modified on Thursday, June 4, 2009 3:03 AM
|
|
|
|
|
Process.Start just starts a process; just as Shell does. However, it returns a Process instance. If you call WaitForExit on this Process instance, your main application's thread will block until the process closes
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Is it something like this
dim x as an integer
x = Process.start("program.exe")
call Waitforexit(x)
Please reply asap.
|
|
|
|
|
No, something like this:
Dim p As Process = Process.Start(...)
p.WaitForExit()
You can also pass an additional parameter to WaitForExit which specifies a timeout period - useful if your application is waiting for a process to finish, but cannot finish for some reason
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks.
Now i have another problem.sorry.
I have delete a file in a directory
but only if the file exists
i am trying to use mycomputer.getfiles.method but don't no how to do it.
Please reply.
|
|
|
|
|
If(File.Exists("FilePath"))<br />
File.Delete("FilePath")<br />
End If
You may want to look into the System.IO namespace - in particular the File, Path, Directory, DriveInfo, FileInfo and DirectoryInfo classes
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
it says file isn't declared.
Help!
|
|
|
|
|
You may want to make a new topic for completely unrelated topics. And chances are that you need to add an Imports System.IO at the top of your code file
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
ya i got it now
All problems solved.
Thanks so much to every one for helping me.
|
|
|
|
|
i have got a source code file (classlibrar style), which has successfully been impiled to a DLL file.
so how can i load this dll file in my .net vb project? i want details ,thank you!
|
|
|
|
|
1. Add the file to your project:
In the solution explorer,
right Click on your project,
select add --> existing item.
Find the dll file and add it.
2. Add a reference to the dll
in the solution explorer,
double click on My Project,
select the references tab.
click add.
select the browse tab
Find the dll file and click ok
|
|
|
|
|
Thank you,i got it.but how can i declare function to use a function in DLL ?
|
|
|
|
|
Once the dll has been referenced, you need to create an instance of it and then you can call any exposed methods or functions it conatins. For example, if your DLL is named MyLibrary and has a function called MyFunction that takes two string parameters. This is how you would call it and use it:
Dim objLib as New MyLibrary<br />
Dim str as String<br />
str = objLib.MyFunction("Hello", "World")
|
|
|
|
|
Hi guys,
I'm working in VBexpress2008 using the sql server compact that comes with it. I'm trying to delete a row from a listbox out of a table using this code:
Private Sub Deleteip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Deleteip.Click
DataSet.IP.Rows(IPlistbox.SelectedIndex).Delete()
DataSet.IP.AcceptChanges()
IPTableAdapter.Update(DataSet.IP)
End Sub
it all seems to work fine, deleteing it from the dataset, no errors when running the tableadapter.update but when i go back into it they are there again!
any suggestions would be appreciated, thanks
Chris
|
|
|
|
|
A possible answer might be that when you re-run the code it is copying the database from the original into the bin\debug folder.
This happens when you run in debug so that the testing does not trash the original database.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Does your table adapter have a delete statement defined within the dataset?
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
The problem is that you called AcceptChanges before you called Update. This tells the DataSet that the modifications that it is holding should now be considered synced up with the database. now that you've essentially wiped out all the changes, when you call Upgdate, the DataAdpater doesn't see any changes to make to the backing database, so nothing changes. When you go run your code again, you see the database exactly how it was when you ran it the last time.
|
|
|
|
|
doh! Yuppers!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Wow thanks for the reponse. I think I was going wrong as I was under the impresion that when you mark the row for deletion the acceptchanges removes it from the dataset then the update syncsthe source with the dataset. now I know! and yes, the tableadapter doesn't have a valid delete command.
thanks alot!
chris
|
|
|
|