|
Hi there,
Ours is an automotive inspection business. All our inspectors inspect
the vehicles and took picures as need and upload them to the webserver
from where every body will have access to these pictures on the web.
As part of the regular business, many pictures are bieng added on to the webserver and so the images folder size is getting bigger day by day and hence it puts a lot of burden on the webserver.
So to move the images from the images folder on the webserver we are implementing a manual process of archiving those images and
cleaning the production images folder on the webserver.
Now, we want to developed some .exe(say FileMover.exe) file that handles the image move activities and schedule it in the windows shecdules to run at the specified intervals. Our idea is to develop this FileMover.exe using Visual Basic.net using Visual studio 2005.
So i need help on how do i do it. I think Windows Service application type project is the right one to pick and go from there.
Could some one plese help me with any articles written on this?
Thanks
-L
-- modified at 16:58 Wednesday 15th February, 2006
|
|
|
|
|
Written on what? Copying/Moving files (File or FileInfo classes), watching a folder (FileSystemWatcher class), creating a service, or processing the images?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave,
I am sorry for the confusion. I have modified my question to my best.
My question was is Windows Service type of project can create an .exe for me? Becauase there are different type of project types when i File/New project in Visual Studio 2005.
And also i was asking if i could be helped with a sample Windows Service application and how to create an .exe file from the application in Visual Studio 2005. Becauase this will be my first time trying to create an .exe type of application using Visual studio. Hope this is understandable.
thanks
-L
|
|
|
|
|
Slow Learner wrote: Becauase this will be my first time trying to create an .exe type of application using Visual studio.
With all due respect, if you are not familiar with VS 2005 at all and you want to write a Windows Service, I think you will get into some deep water. You need to walk before you can run.
If the app's requirements are simply to move files from one directory to another on a schedule, why not simply use a BAT file which can be run as a Windows scheduled task? There's still a lot that can be done in BAT files these days, especially for apps that are not too complex as this one. They have a much lower overhead too.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Yeah, I agree with Steve. If this is your first app, you've really bitten off more than you can chew.
Creating a service isn't really easy for a lot of reasons. To start with, you don't get to put in a UI. Services, on startup, are expected to create a seperate thread to start their main execution loop. You also can't just start the service and debug it. You've got to install i, start the service, then attach the debugger to it, making startup problems a bit of a pain to diagnose, ... The list goes on...
If you're not doing any processing of these file, just copying them, you can get away with creating a batch file (*.CMD or *.BAT) run from Windows Scheduler (Scheduled Tasks) that'll do this for you quite easily.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I appreciate all your help and caution. I understand that but i have enough time to understand that and implement in VS 2005. So i thought i could give it shot and in the entire process i will have an oppertunity to learn all about windows services and also get used to VS 2005.
Well i could try the same thing in .bat file or else in vbscript and then schedule it to run. I am not sure if we can schedule a vbscript file. Can i schedule a .vb script file (say FileMove.vb) as .bat file? If i can schedule a vbscript file i think i will opt it writing in vbscript.
Please suggest.
Thanks
-L
|
|
|
|
|
I see where you are coming from and in some ways agree, but keep in mind not to over-engineer the solution.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
It would be best to not "play around" until the dead-line comes. Get a solution that works first, then you can "play around" writing a better solution. If your dead-line is comming up, you've already got something that works and you don't have to scramble to get your service solution to finished.
So, having said that, yes, you can schedule a .BAT or .VBS to run. If you want to run the .VBS script directly, the command line would be:
cscript
The //e:vbscript thing is in there because some companies disable the Scripting Hosts associations, thereby cripple WSH's ability to determine that correct scripting engine to the run code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
On the DriveList control when you select a drive there is an icon telling you what kind of drive you selected. For example: I select the C: drive then the icon for a hard drive. Another for a floppy, removable drives, and so on.
I want to place the icon of the drive selected on the root node of a treeview. Is there a way to read the icon and us it as an image on the treeview?
Thank you,
Quecumber256
|
|
|
|
|
No, you can't get the icons out of the DriveList control, which, BTW, is not a .NET control.
You CAN however build your own. All you need to do is get the icons out of Shell32 (you already asked about this) and either save them as *.ico files or use some other icons that you want. You use that GetDriveType(?) function that you already know about to get the, well, type of drive that each letter is, then you can set your own icons in your TreeView.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
I stumbled on how to do this. I have a third party software called IconForge that will allow you to aquire icons from various .DLLs. I'm aquiring them through the Shell32.DLL. I have extracted about 14 of them and using IconForge converted them into 24 and 32 bit icons.
If you are interested here is what I stumpled on. I have modified it for my specific needs.
Private Sub drvSource_Change()
Dim nodX As Node
Dim fs As Object, drv As Object
Dim drvLtr As String
tvwSource.Nodes.Clear
Set fs = CreateObject("Scripting.FileSystemObject")
Set drv = fs.getdrive(fs.GetDriveName(drvSource.Drive))
drvLtr = drv.DriveLetter
Select Case drv.DriveType
Case 0
'Unknown
Case 1
'Removable
If UCase(drvLtr) = "A" Or UCase(drvLtr) = "B" Then
'Floppy drive
Set nodX = tvwSource.Nodes.Add(, , "r", drvSource.Drive, 1, 1)
Else
Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, 4, 4)
End If
Case 2
'Fixed
Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, 2, 2)
Case 3
'Network
Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, 3, 3)
Case 4
'CD-ROM"
Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, 5, 5)
Case 5
'RAM Disk"
Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, 6, 6)
End Select
'Set nodX = tvwSource.Nodes.Add(, tvwChild, "r", drvSource.Drive, drvSource.ListIndex, drvSource.ListIndex)
tvwSource.LineStyle = tvwRootLines
'nodX.EnsureVisible
End Sub
Thank you
Quecumber256
|
|
|
|
|
Great!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am in need of creating a custom control. What I need is to be able to create a listbox that is larger than the default, for use in a touch screen application. The easiest way to create custom controls is to override the base class of the control you want to create. I see several limitations of applying the mentioned technique for my control, seeing how I must overide the entire rendering and input capture of the entire control.
Can I use the described technique or do I just need to create a new control from scratch?
Kevin
|
|
|
|
|
You don't have to redo the entire control, just the drawing part. The ListBox class exposes properties and events that you supply the code for to custom draw the listbox. Check this[^] out for an example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a MainForm (MDIParent), a ChildA form and a Child1OfChildA Form. I have a Panel control on ChildA Form, How can i place Child1OfChildA on this panel controll on ChildA from? and how can i show it with a tab control?
Thanks
|
|
|
|
|
A couple of things...
First, you can't add an MDIChild form to another control. It'll only work inside an MDIParent form, in its MDIClient control, which is hidden, but plainly obvious on your MDIParent form. THe MDIClient control is docked to take up the entire unused area of an MDIParent form. You can get a reference to the MDIClient control in the MDIParent form using:
Dim mdiClient As MDIClient
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is MDIClient Then
mdiClient = ctrl
Exit For
End If
Next
If mdiClient Is Nothing Then
Throw New Exception("MDIClient control not found!")
End If
Don't get any cute ideas, there can only be one MDIClient control on a form. You can get more information on it here[^], but it's not very well documented. Also, Windows does NOT support a window being both an MDIParent AND an MDIChild, so you can NOT create a form that is both and nest as many MDIChild forms as you want inside each other.
You CAN, however, treat a form as a control! Ever notice that the Form class inherits from the Control class? Well, in .NET 1.0 and 1.1, it inherits from Control. In .NET 2.0 it inherits from ContainerControl, which eventually inherits from Control, and so does any Windows Forms control, like Button or Label or TextBox. Hmmmm... How could you get a Form to behave like any other Control?
It's not as simple as adding it to another forms Controls collection, but it's very close! Click here[^] for the answer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 16:14 Wednesday 15th February, 2006
|
|
|
|
|
RageInTheMachine9532
Thank you for your response, i really appriceate it and thank you for the links.
|
|
|
|
|
In my Reports I use ListViewControl. I wantto fill Listview Asynchronly,and use all of its properties , how could i do this?
:-> ^);P;)
'Delegate Sub AddItemsDelegate(ByVal Item As ListViewItem)
'Private Sub AddItems(ByVal Item As ListViewItem)
' If lvCekler.InvokeRequired Then
' Dim d As New AddItemsDelegate(AddressOf AddItems)
' Me.Invoke(d, Item)
' Else
' lvCekler.Items.Add(Item)
' End If
'End Sub
|
|
|
|
|
Hi.
I've a form with 12 TextBoxes. It names are:
pred1
pred2
...
pred12
How can I add counter number to Names in For...Next cycle?
( for i=1 to 12
something=pred {<- i} (?)
next i)
Best regards,
Konstantin
|
|
|
|
|
have you ever heard CONTROLS Collection ?
|
|
|
|
|
...yeah. so what?
i'm writing macros in excel. is it possible to use it there?
Best regards,
Konstantin
-- modified at 9:47 Wednesday 15th February, 2006
|
|
|
|
|
all textboxes are in PANEL named pnlTextBoxes
dim txt as Syetm.Windows.Forms.Textbox<br />
For each txt in pnlTextBoxes.controls<br />
SomeThing=txt.AnyPropery<br />
Next
|
|
|
|
|
In VBA there is no a lot of objects.....such as pnlTextBoxes, controls and other...
Best regards,
Konstantin
|
|
|
|
|
Hi all,
We want to start a VB6 windows app from a windows service in VB.NET 2003. After installing the windows service, it starts the app as a "process" (we can see it in the task manager) and we cannot see the form, so we couldn´t inertact with it.
How we can make to start normally this window app?
Thanks in advance...
Time flies like an arrow
-- modified at 9:57 Wednesday 15th February, 2006
|
|
|
|
|
The service which starts the app has to have the "allow interact with desktop" flag set in order to be able to propagate this to any application started by it and in order to show up with a form or sth similar.
The other method would be to you start the application in the context of a user instead of the system, which has the benefit that the program does not run in the system context (with even more that administrative rights) but only in the limited user context.
All Settings to be made in Administrative Tools/Computer Management/Services.
|
|
|
|
|