473,770 Members | 6,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need some help...

This will be my very first VB.Net application and it's pretty simple. But
I've got a snag in my syntax somewhere. Was hoping that someone could point
me in the right direction.

The history:
My work involves creating custom packages of our software product for golf
courses that purchase our software. The course data is kept as a back up in
the event the course needs us to replace their custom files. Each course has
a folder of it's own data under a centralized directory.

The problem:
The custom files are going to become a serious storage issue as our customer
base increases.

The solution:
Compress each course folder into an individual .cab file containing all of
the course's custom files and then archive these files to storage media such
as CD/DVD.

Where I need help:
I found some code for implementing a command line window and passing it a
string through a stream. The command window is being instantiated, but the
string is not getting passed or my syntax for running the makecab utility is
off-base. I've spent several hours looking for sample code that would
explain the makecab syntax and I've also tried to determine if the
parameters are being passed in to the Sub correctly. I've set a break at the
line where the string should be passed to the command window, but I can not
seem to get a respnse from the watches that have been set. I've included a
copy of the sub that I'm using to compress the files. If this is not the
correct forum for this, I do apologize. A nudge in the correct direction
would be deeply appreciated.

Private Sub CompressFolder( ByVal ToFolder As String, ByVal FromFolder As
String, ByVal FinalFile As String)

Dim CompressProcess As Process = New Process

CompressProcess .StartInfo.File Name = "cmd.exe"

CompressProcess .StartInfo.UseS hellExecute = False

CompressProcess .StartInfo.Crea teNoWindow = True

CompressProcess .StartInfo.Redi rectStandardInp ut = True

CompressProcess .StartInfo.Redi rectStandardOut put = True

CompressProcess .StartInfo.Redi rectStandardErr or = True

CompressProcess .Start()

Dim stmStreamIn As IO.StreamWriter = CompressProcess .StandardInput

stmStreamIn.Aut oFlush = True

Dim stmStreamOut As IO.StreamReader = CompressProcess .StandardOutput

Dim stmStreamErr As IO.StreamReader = CompressProcess .StandardError

stmStreamIn.Wri te("makecab.ex e /L %ToFolder% %FromFolder% %FinalFile%" &
System.Environm ent.NewLine)

stmStreamIn.Wri te("exit" & System.Environm ent.NewLine)

If Not CompressProcess .HasExited Then

CompressProcess .Kill()

End If

stmStreamIn.Clo se()

stmStreamOut.Cl ose()

stmStreamErr.Cl ose()

End Sub
Dec 9 '06
46 2537
Thigh boots???? Hmmm... No, better not go there. :)

Yes, that's exactly what I mean. This doesn't work for me.
i_Compress.Comp ressFolder(strF older,
Path.ChangeExte nsion(Path.Comb ine(strTargetDi r, strDeepestNode) , ".cab"),
"", 0)

still doesn't work and that:
And this DOES work for me.
Dim strFinalFile As String =
Path.ChangeExte nsion(Path.Comb ine(strTargetDi r, strDeepestNode) , ".cab")
i_Compress.Comp ressFolder(strF older, strFinalFile)

does work?
Should I send someone to help you up? :)
Dec 18 '06 #41
Cor,

I read that one. :) But I'm just letting Stephany know what is and isn't
working for me. My project is otherwise working perfectly well. I've
actually started my project over, thinking some changes that I had made
elsewhere, through my own stupidity, of course, had botched my solution. In
both solutions, the exact same errors occured on that line of code. I'm
perfectly happy with the code working as it is. I really don't want anyone
wasting their time on it, so if it is getting to that point, I apologize.

Bruce

"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:eW******** ******@TK2MSFTN GP02.phx.gbl...
Bruce,

In my idea are you too much ironing. In this case it is in my idea better
to carpenter a small project where only the problems are in.

In that way you can more easily eliminate the things that are going wrong
to come to the right result.

(Almost the same advice as Tom gave in another question this night (for
me)).

Cor


Dec 18 '06 #42
It's definitely time for the black boots and whip this time!!!!!!!!!!! !!!

I would like you to try it with EXACTLY this line:

i_Compress.Comp ressFolder(strF older,
Path.ChangeExte nsion(Path.Comb ine(strTargetDi r, strDeepestNode) , ".cab"),
"", 0)

Copy and paste it verbatim and remove any line breaks that propogate
themselves.

Do not, I repeat, DO not modify the line in any other way.

Do not, I repeat, DO not attempt to run the program.

Compile it and see if you get any compile time errors and if so report back.

If it compile ok, then you can run it and report back with the results.

If that doesn't work I'll come and marry you and, believe me, you wouldn't
want that!!!!!!!!!
"Bruce W. Darby" <kr****@comcast .netwrote in message
news:qe******** *************** *******@comcast .com...
Thigh boots???? Hmmm... No, better not go there. :)

Yes, that's exactly what I mean. This doesn't work for me.
> i_Compress.Comp ressFolder(strF older,
Path.ChangeExt ension(Path.Com bine(strTargetD ir, strDeepestNode) , ".cab"),
"", 0)

still doesn't work and that:

And this DOES work for me.
> Dim strFinalFile As String =
Path.ChangeExt ension(Path.Com bine(strTargetD ir, strDeepestNode) , ".cab")
i_Compress.Comp ressFolder(strF older, strFinalFile)

does work?

Should I send someone to help you up? :)

Dec 18 '06 #43
Hmmm... That one worked, though for the life of me I cannot see anything
different from any of the previous lines that you provided. So I suppose
you're safe from the wedding bells. :) Besides, even though I live in Utah,
my wife isn't into polygamy. LOL

Ummm... if I put a line continuation character in, could I get a few extra
lashes?? ROFL

Thanks Stephany,
Bruce

"Stephany Young" <noone@localhos twrote in message
news:OT******** *****@TK2MSFTNG P06.phx.gbl...
I would like you to try it with EXACTLY this line:

i_Compress.Comp ressFolder(strF older,
Path.ChangeExte nsion(Path.Comb ine(strTargetDi r, strDeepestNode) , ".cab"),
"", 0)

Dec 18 '06 #44
I suspect that you had a tray comma, a missing comma or a comma in the wrong
place.

When I stragecially misplaced a comma or 2 I got one or more of the errors
you saw, byt the important thing is that they were compile-time errors not
run-time exceptions.

When you are posting about 'errors', it is important that you are absolutely
clear as to the type of error or exception that you are talking about, cos
even though we're pretty good, we don't have telepathy down to a fine art as
yet.

Don't get lost in the snow :)

"Bruce W. Darby" <kr****@comcast .netwrote in message
news:fN******** *************** *******@comcast .com...
Hmmm... That one worked, though for the life of me I cannot see anything
different from any of the previous lines that you provided. So I suppose
you're safe from the wedding bells. :) Besides, even though I live in
Utah, my wife isn't into polygamy. LOL

Ummm... if I put a line continuation character in, could I get a few extra
lashes?? ROFL

Thanks Stephany,
Bruce

"Stephany Young" <noone@localhos twrote in message
news:OT******** *****@TK2MSFTNG P06.phx.gbl...
>I would like you to try it with EXACTLY this line:

i_Compress.Comp ressFolder(strF older,
Path.ChangeExt ension(Path.Com bine(strTargetD ir, strDeepestNode) , ".cab"),
"", 0)


Dec 18 '06 #45
Bruce this isn't a big deal but why I mentioned it before was so you (an
others) understand, what you are suggesting is "impossible ". I believe you
think the function calls are passed along as parameters to be "parsed" by
the function itself and they aren't. The outer function has no idea that
you supplied the parameters indirectly via other function calls.

MyFunc1( "this", 15 )
MyFunc1( GetThis(), 3 * 5 )

Are equal (so long as GetThis() returns "this" of course. All computations
"must" be done prior to calling MyFunc1().

It isn't something you should worry about because it can't happen. If a
function returns something "wrong" then yes the function will fail but due
to the bad value not due to the fact that a function was called..
"Bruce W. Darby" <kr****@comcast .netwrote in message
news:T9******** *************** *******@comcast .com...
These are the same errors I was receiving when I tried what you suggested,
which is why I believe that there may be a bug in the .dll because it's
(possibly) parsing the command strings only for commas and when it sees
one, it goes looking for the next piece of the puzzle instead of trying to
make sure the piece I've provided it really fits. When I present it with
just a variable it behaves as it should. :)

Dec 18 '06 #46
Tom,

I appreciate everything that you've done to assist me in learning. I've got
a hard head sometimes, but it also allows me to bang it against the wall
until something sinks in. :) Of course, that really leaves a bloody mess on
the wall... ROFL

Happy Holidays,
Bruce
"Tom Leylan" <tl*****@nospam .netwrote in message
news:eA******** ********@TK2MSF TNGP06.phx.gbl. ..
Bruce this isn't a big deal but why I mentioned it before was so you (an
others) understand, what you are suggesting is "impossible ". I believe
you think the function calls are passed along as parameters to be "parsed"
by the function itself and they aren't. The outer function has no idea
that you supplied the parameters indirectly via other function calls.

MyFunc1( "this", 15 )
MyFunc1( GetThis(), 3 * 5 )

Are equal (so long as GetThis() returns "this" of course. All
computations "must" be done prior to calling MyFunc1().

It isn't something you should worry about because it can't happen. If a
function returns something "wrong" then yes the function will fail but due
to the bad value not due to the fact that a function was called..
"Bruce W. Darby" <kr****@comcast .netwrote in message
news:T9******** *************** *******@comcast .com...
>These are the same errors I was receiving when I tried what you
suggested, which is why I believe that there may be a bug in the .dll
because it's (possibly) parsing the command strings only for commas and
when it sees one, it goes looking for the next piece of the puzzle
instead of trying to make sure the piece I've provided it really fits.
When I present it with just a variable it behaves as it should. :)


Dec 19 '06 #47

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6328
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334, column 13: there is no attribute "SRC" <bgsound src="C:\My Documents\zingwent.mids"> You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is...
5
2196
by: John Flynn | last post by:
hi all i'm going to be quick i have an assignment due which i have no idea how to do. i work full time so i dont have the time to learn it and its due date has crept up on me .. As follows: Objectives The purpose of this assignment is to have you practice the design of object-oriented classes, including one or more of the following concepts
0
1840
by: xunling | last post by:
i have a question about answering ..... this topic is "need help" what do i have to write at te topic line, !after i have klicked the "answer message" button ive tried many possibilities, all dont work "Re:" need help "Re:need help"
9
2937
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
7
3306
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,
15
4642
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
16
2539
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client uses IE to talk with a server. The user on the client (IE) sees an ASP net page containing a TextBox. He can write some text in this text box and push a submit button.
8
2750
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only the sequence nos and it should be such that i can access it through the structure .plz help me .
0
3961
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
20
4285
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.