|
I'm assuming he's talking about find out which version the app is running under in his own code, not by crapping out an app and looking at the wreckage.
|
|
|
|
|
Hi, I'm trying to create one FTP automation using vb.net. Which is consist of the following requirement.
1) Downloading file (with specific file name)
2) Move the file at the FTP server to another directory
3) Uploading file
-All of the task need to be schedule at specific time and it's on daily basis.
Can someone help me on this matter.
|
|
|
|
|
You can start with the System.Net.FtpWebRequest[^] class to download files and rename them upload them. It exposes a basic FTP client in a class.
You'd probably write this as a Console application and schedule it to run using the Windows Scheduler
(Control Panel -> Scheduled Tasks).
|
|
|
|
|
I have implemented the IOleCommandTarget interface in a VB.NET 2005 Browser Helper Object. First, I wanted to share the code with everyone since it took me a while to get it working and I couldn't find any examples on the 'Net.
Now I want to be sure I know what to do with my new found toy. Specifically:
Do I need to output something from the Exec sub?
What do I output from the QueryStatus sub to answer Internet Explorer's interrogation?
Thanks! Here's the code:
Imports System
Imports System.Runtime.InteropServices
Namespace MyPopUpBHO
#Region "Interface Definition"
<structlayout(layoutkind.sequential,> _
Public Structure OLECMDTEXT
Public cmdtextf As UInt32
Public cwActual As UInt32
Public cwBuf As UInt32
Public rgwz As Char
End Structure
<structlayout(layoutkind.sequential)> _
Public Structure OLECMD
Public cmdID As UInt32
Public cmdf As UInt32
End Structure
' Interop definition for IOleCommandTarget.
<comimport(),> InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IOleCommandTarget
Sub QueryStatus( _
ByRef pguidCmdGroup As Guid, _
ByVal cCmds As UInt32, _
<marshalas(unmanagedtype.lparray,> ByVal prgCmds() As OLECMD, _
ByRef pCmdText As OLECMDTEXT)
Sub Exec( _
ByRef pguidCmdGroup As Guid, _
ByVal nCmdId As Integer, _
ByVal nCmdExecOpt As Integer, _
ByRef pvaIn As IntPtr, _
<marshalas(unmanagedtype.sysint)> ByRef pvaOut As IntPtr)
End Interface
#End Regino
<guidattribute("b722bccb-4e68-101b-a2bc-00aa00404770")> _
Public Class ctvb
Implements IOleCommandTarget
Public Sub Exec( _
ByRef pguidCmdGroup As Guid, _
ByVal nCmdId As Integer, _
ByVal nCmdExecOpt As Integer, _
ByRef pvaIn As IntPtr, _
<marshalas(unmanagedtype.sysint)> ByRef pvaOut As IntPtr) Implements IOleCommandTarget.Exec
System.Windows.Forms.MessageBox.Show("Hiya Exec!")
End Sub
Public Sub QueryStatus(ByRef pguidCmdGroup As Guid, _
ByVal cCmds As UInt32, _
<marshalas(unmanagedtype.lparray,> ByVal prgCmds() As OLECMD, _
ByRef pCmdText As OLECMDTEXT) Implements IOleCommandTarget.QueryStatus
System.Windows.Forms.MessageBox.Show("Hiya QueryStatus!")
End Sub
End Class
End Namespace
|
|
|
|
|
David Seger wrote: Do I need to output something from the Exec sub?
This is the command that your code has to interpret and execute. Remember, your supplying the implementation of an interface that OLE is calling you with. This caommand can be executed in a seperate thread that your code sets up and starts. Any return value should be one of thoses documented here[^].
David Seger wrote: What do I output from the QueryStatus sub to answer Internet Explorer's interrogation?
This is normally filling in the status of the various commands you got in the Exec implementation. If your commands are still running, you update the status of those commands in the structures passed in from IE.
|
|
|
|
|
How do you format the date time to just date?
for example, this is what i retrievedd from the database: 12/31/2008 12:00:00 AM, but i just want to show the date and no time.
|
|
|
|
|
Hi Muhammad;
This will display the date only
' Simulate date and time from the DB
Dim dt As DateTime = Now
' This will display the date only
MessageBox.Show(dt.ToString("MM/dd/yyyy"))
Fernando
|
|
|
|
|
No need to ask the same question twice, but 7 minutes apart. If someone doesn't answer the first they ain't going to answer the second.
|
|
|
|
|
EliottA wrote: If someone doesn't answer the first they ain't going to answer the second.
I'm afraid Fernando has proven you're wrong about that...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
fair enough. Point still stands..
|
|
|
|
|
I want to remove the time from (2/6/2009 12:00:00 AM ).
I want to use only date without displaying the time (in vb.net)
|
|
|
|
|
|
Or
dateOnly.ToShortDateString()
|
|
|
|
|
I am using VB.net 2009. How should I bring my form to front. Right now I am able to restrict the user to open the duplicate instance only. But the already opened instance remains minimized. So sometimes , it leads to the confusion that the form is not getting opened and Actually it is already opened in minimized window state. If i changes the window state to maximized. Then it changes the window state also, Because sometimes, the window is in normal mode and is minimized also / the window state us in maximized and minimized mode . How should I resolve this issue?
Dim objInv As frmWaste = Nothing
For i As Integer = 0 To My.Application.OpenForms.Count - 1
Select Case Filename
Case "frmAdd"
If (My.Application.OpenForms(i).Name = Filename) Then
objInv = My.Application.OpenForms(i)
If (objInv .UserID = id) Then
objInv .Focus()
Return True
End If
End If
End Select
Next
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Before you set the Focus, try checking the WindowState and if it is minimised, set it to Normal.
Pankaj Garg wrote: if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
I have no idea!!!
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
There's no such thing as VB.NET 2009. It's 2002, 2003, 2005, or 2008... and soon to be 2010.
|
|
|
|
|
Sorry, I Meant 2008
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
hi.....
i did one commercial project in vb.net...... i just want to display my billing details as report form..... i am having some listview content and some field obtained from access database..... i want to view this as in my report and i want proper alignment too...... how to pass my listview content to crystal report...... and also i need how to use crystal report in vb.net
|
|
|
|
|
refer following link
Crystal Report[^]
above search generate a list of article which is helpful for you
|
|
|
|
|
Firstly there are several ways to pass data to Crystal, including using a Typed DataSet which could be used with your ListView and your Crystal Report.
<blockquote class="FQ"><div class="FQA">NaliniNagarajan wrote:</div>and also i need how to use crystal report in vb.net</blockquote>
You really should buy a book as Crystal Reports is a very large subject in its our right.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hello
I'm written an application using VB 6 to remote workstation, such as restart, shutting down and locked it.
Till now I'm still looking how to do that then I read your mail.
If u don't mind would you share with me, the code sample or what ever it is, thanks a lot before..
Regards Bono,
|
|
|
|
|
Try replying to the thread this equates to. Who is this aimed at?
You need to look into DCOM, but really you should not be using VB6, you should be using VB.NET and remoting.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
bono from indo wrote: I'm written an application using VB 6 to remote workstation,
bono from indo wrote: If u don't mind would you share with me, the code sample or what ever it is, thanks a lot before..
So, you are writing an application, but you want others to give the code samples to you. Correct me if I am wrong, but doesn't that mean, you are not writing that application at all but somebody else is? So... it's not your problem any more, but somebody else's and your request is therefore redundant. Wasn't that nice and easy?
|
|
|
|
|
I make a software in vb.net which is used multithreading
I want to Synchronization of threads so that multiple thread cannot be able to access same code at the same time ................
Thanx!!!!!
|
|
|
|
|
Without all the description that a question like this needs to be clear, I think you may need to look into using a SyncLock.
' Locks a section of code so only one thread can run it at a time
SyncLock lockObject
' Code
End SyncLock
The documentation on SyncLock can be found here[^]. The hardest part about using it is picking an appropriate object to use for the lock.
|
|
|
|