|
I don't know if this is the best way, but since it has been some time since you posted this, I'll take a shot at it.
You could use a Microsoft Internet Transfer Control to check versions listed in an html file.
<br />
Dim sTest as String<br />
Dim sUrl as String<br />
sUrl = "http://www.your-url-goes-here.com/versions.txt"<br />
Inet1.AccessType = icUseDefault<br />
sTest = Inet1.OpenURL(sUrl)<br />
Then, you would need to compare the versions that you stored in that file with the versions of the files on the user's computer. There is likely a way to access the versioning information (I cannot find it right now,) but you could always have your application maintain a similar file on the user's computer that could would contain the versioning info.
Then, you could use the "OpenURL" to grab any needed files (saving them as binary.)
Here is the sample from MSDN
<br />
Dim b() As Byte<br />
Dim strURL As String<br />
' Set the strURL to a valid address.<br />
strURL = "FTP://ftp.GreatSite.com/China.exe"<br />
b() = Inet1.OpenURL(strURL, icByteArray)<br />
<br />
Open "C:\Temp\China.exe" For Binary Access _<br />
Write As #1<br />
Put #1, , b()<br />
Close #1<br />
Hope that helps.
|
|
|
|
|
I am new at all this, and this looks like a pretty good place for advice, these guys know what they are talking about.
O.K. I am studying programming and have managed to buy a full set of Visual Studio 6.0 Enterprise Edition. Three CD's. In bold there is written, msdn and Office Test Platform & Development Tools.
So what's the problem.
The platform works normally, but the help files won't load.
During the installation, when prompted for msdn CD No.1,
it will not accept it, and it is the same place I have just loaded the program with.
What am I doing wrong?
|
|
|
|
|
The MSDN Library consists of 3 CD's that will say MSDN Library.
|
|
|
|
|
If you have a Sub or Function with an Optional argument passed ByRef, what happens if you try to muniplate the contents of the variable if it wasn't passed in?
Eldon Zacek
VP of Engineering
Czech-Mate Enterprises, LLC
|
|
|
|
|
VB.NET: All optional variables have a constant default value. If no value is passed in, the argument will have the default value. You can manipulate it as much as you like, but when the procedure exits, your changes will be discarded.
VB6: Optional arguments can have default values, in which case the same rules as VB.NET apply. If they don't have a default value, you will get an error when you try to access them. Use the IsMissing function to determine whether a value has been passed in.
|
|
|
|
|
How do I create such a beast? I've search all over the internet for the answer, and have yet to find the solution.
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Hi,
Can anyone please clarify me in the following problem?
I have created an application in vb.net, which runs some process in background using task scheduler. when I access a network folder like "\\server\somedir" in my GUI it will work, because the loggedon user has permission to that network folder to connect. but I am running the background task as different user who is not having permission to that nework folder. But in windows 2000,XP, when we try to access to that nework folder using network places, it will prompt for username and passwork to connect to network folder. If I know this username and passwork in my background process, how should I connect to network folder in my vb.net programme. After some struggle, I came to know that I need to use CreateProcessWithLogonW API for this. But I am not able to make it work in my VB.net programme and connect to that network folder. And I tried impersonate the user and then create process using System.Diagnostics namespace. but in this case creating process will not take the impersonated user credentials, it only considers default loggedon user credentials. I have tough time in finding this.
Please Help me as soon as possible
Thanking you
Regards
PraveenP
|
|
|
|
|
Hi,
I sense that You wanted to execute a file on a remote machine. You can create a process in remote machine using WMI. Try reading documentation on System.Management Namespace which speaks on WMI. Creating a process in this way can impersonate the user credentials that you have specified by your background process.
Refer http://www.codeproject.com/useritems/wmi.asp for more details
Ravi Shankar S
Product Designer
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
Hi Guys
Im making a messanger for myself... in vb.net... everything works greate if i use text, but as soon as i try to send an object through sending works fine but receiving gives me lots of problems...
Canyone help me with this?
Here is my code for receiving
Public Sub listen()
Dim formater As New BinaryFormatter()
Do While True
Dim message As New Message()
Try
message = formater.Deserialize(stream)
RaiseEvent update(message.ToString)
RaiseEvent update(message.ToString & vbNewLine)
Catch e As Exception
MsgBox(e.Message)
End Try
'If message Is Nothing Then Exit Do
Loop
End Sub
|
|
|
|
|
Hi,
In VB6 i use this sample of code to print directly to the printer.
I mean EPSON compatibile dot-matrix printers
Open “LPT1” For Output as #1 Or
Open “\\Server\printer” For Output as #1
Print #1, “something i what to print”
Print #1, “something else ...”
....
Close #1
What I need is to open printer port (LPT1 or \\computer\printer ) like any other file on hard drive, as simple as posible.
I don’t need to print any graphics, just draft (plain) text with a lot of ESCAPE sequences like Pica,Picacondesd, Elite ...
When I use
FileOpen(1, “LPT1”, OpenMode.Output)
PrintLine(1, "This is a test.")
in VB.NET I get an error
Additional information: FileStream was asked to open a device that was not a file. FileStream's constructors that take a String will only work with devices that are really files. If you need support for devices like "com1:" or "lpt1:", then call CreateFile yourself then use the FileStream constructors that take an OS handle as an IntPtr.
Let me know if you have any sugestions for my problem
Thanks in advance
p.s
Sorry for my bad English
Tancev
|
|
|
|
|
Is anyone familiar with Right Fax From Viewer? You can add that to your toolbox from COM Components. The reference name is AxInterop.AXRfaxVwRctrLLib. I can add this control and if i load a tif file in the property it works but not in the run time. this is pretty cool tool for editing .tiff files. if anyone has any luck please let me know. your help will be greatly appreciated. thanks
Zulfikar Ali
|
|
|
|
|
Hi all,
In .NET all data types (Integer, Long, String, ...) are objects. But in my opinion, these data types don't really behave like normal objects. I noticed the following behaviour:
Dim l As Long<br />
<br />
Msgbox(l = Nothing)<br />
'Results in True<br />
<br />
Msgbox(l = 0)<br />
'Results in True
Even stranger behaviour:
Dim l As Long<br />
<br />
l = 0<br />
<br />
Msgbox(l = Nothing)<br />
'Results in True
I hoped that in .NET there would be a way to determine if a variable has been set or not. For example you have a class with a ID property (long), you would implement it like this:
Public Class Test<br />
Private _id As Long<br />
Public Property ID As Long<br />
Get<br />
Return _id<br />
End Get<br />
Set(Value As Long)<br />
_id = Value<br />
End Set<br />
End Property<br />
End Class
Suppose you would like to have functionality in this class, to save the data. In de Save sub, you would like to check if the ID property was set or not. I hoped you could do it like this:
Public Sub Save<br />
If _id = Nothing Then<br />
'Raise error to tell the ID property was not set.<br />
Else<br />
'Save data<br />
End If<br />
End Save
Was it wrong of me to expect such behaviour, or am I wrong somewhere?
Thanks,
Jan
|
|
|
|
|
First, you can't check for null references with If x = Nothing ... - you have to use If x Is Nothing ...
Second, you can't perform reference comparison on value types. If x is a value type, If x Is Nothing ... will not compile.
Try something like:
Public Class Test
Private _id As Long
Private _idSet As Boolean = False
Public Property ID As Long
Get
Return _id
End Get
Set(ByVal Value As Long)
_id = Value
_idSet = True
End Set
End Property
Public Sub Save()
If _idSet Then
'Save Data
Else
'Throw exception
End If
End Sub
End Class
|
|
|
|
|
my treeview is very very laggy when calling TreeView.Nodes.Clear .. ive found that if i call TreeView.Invisible = TRUE before clearing the tree, then make it visible again afterwards that it is much much faster.. in C++ i use a comand SetRedraw(FALSE) before clearing the list, then SetRedraw(TRUE) afterwards.. is there anything like this for VB, or is making the list invisible the only hack?
populating the list is just as slow as well unless i make it invisible first.. anyway to turn off the redraw without making it invisible?
thanks!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Yes, this is super easy:
TreeView.BeginUpdate()
TreeView.Nodes.Clear
TreeView.EndUpdate()
|
|
|
|
|
Doh! Sorry, using .NET here...
Anyway, use the API Function "LockWindowUpdate".
Public Declare Function LockWindowUpdate Lib "user32" (ByVal hWndLock As Long) As Long
Then, use this function when Populating or Clearing the TreeView.
Call LockWindowUpdate(Tree.hWnd)
'Populate or Clear Nodes
Call LockWindowUpdate(0)
Always remember to "UnLock" after you are done, otherwise it never repaints. Also, if you are updating more controls (i.e. ComboBoxes) that are on the same Form, just Lock the Whole Form that way painting will not occur on any controls.
I use this in my App all the time and it has sped up the process of loading Forms by up to 70%!
|
|
|
|
|
thanks a ton for the suggestions, works well!
thanks again!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Actually, I figured I would Post this here. This function will Lock as many Windows as you want from Redrawing...unlike the "LockWindowUpdate" Function.
'API Declarations (.NET)
Private Declare Ansi Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
'Routine to Lock a Window from Repainting
Public Sub LockWindowUpdate(ByVal Handle As IntPtr, ByVal Lock As Boolean)
Const WM_SETREDRAW As Integer = &HB
'Enable / Disable Drawing
Call SendMessage(Handle, WM_SETREDRAW, Math.Abs(CInt(Lock)), 0)
End Sub
'API Declarations (VB6)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'Routine to Lock a Window from Repainting
Public Sub LockWindowUpdate(ByVal Handle As Long, ByVal Lock As Boolean)
Const WM_SETREDRAW As Long = &HB
'Enable / Disable Drawing
Call SendMessage(Handle, WM_SETREDRAW, Abs(CInt(Lock)), 0)
End Sub
|
|
|
|
|
I have a legacy app in SETUP form only which appears to be created with VB version 5. Are there any command line parameters for this setup?
Thanks
Davy
Weblog, Ramblings and more...
www.latedecember.com
|
|
|
|
|
Davy Mitchell wrote:
Are there any command line parameters for this setup?
More info....
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
|
May I know how to launch an external exe file from my application. Just like launching an external Word Document from application.
Besides that, any code that can be used to prevent an application that being launched more than one time.
please help. thanx in advance.
|
|
|
|
|
Desmond wrote:
May I know how to launch an external exe file from my application.
Use the Shell command. There are ways to check to see if an instance of a Word or Excel object is already in existence such as GetObject . Hope this helps.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Hi,
You may use Process.Start (from System.Diagnostics.Process). That provides granular control over the process you are starting.
Perhaps the following URL should open MSDN Documentation too:
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic.htm
process.Start("http://www.codeproject.com") where process is an object of Process opens the default browser and navigates to codeproject.com
While shell might still execute system commands, you might not be able to control execution of those programs to the level that Process allows you to do so.
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Hello
I've got a problem with VB.NET/Windows Application. I have a DataSet, and I want to connect columns from different DataTables to one view in the DataGrid. Is this possible?
/e
|
|
|
|