|
Hi,
Thanks for your reply.
I'm looking for a code that displays its own application version.
The application is published on the server, the users install the application from the server.
When their is an update on the application, the updated version is available to the user but the version number that the user is using is not know to them.
So I would want a message box to display the version.
|
|
|
|
|
Ah, ok,
Look at My.Application.Info there you will find various properties. Also there is more under My.Application.Deployment where you will find, CurrentVersion and UpdatedVersion that can be used for various upgrade scenarios.
Cheers,
dave
|
|
|
|
|
Thanks for your suggestion.
Will check out.
|
|
|
|
|
Hello Experts,
I seen a software of redgate which name is smartassembly.
Regarding how can i inject dlls with the exe. This Process is also called Dependency Mearging.
Please give me the ideas.
If you can think then I Can.
|
|
|
|
|
What do you want to do exactly ? What is it that you want to achieve ? You want to take dlls that your project uses, and make them part of the exe, so they are not seperate files ? You need to decompile your dlls, if you don't have the source already, and add the source to your main project. A tool would do this by decompiling all the source, and then merging it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Actually my application have two dlls in which application is dependent. I want to make my application to portable.
So i want to inject those dlls to with my application. i sees a software of redgate (smartassembly). Its works exectly which i want.But i want to use without purchasing any application. This process is called Dependency Mearger in software.
Please give me the technique for doing that.
Thanks
If you can think then I Can.
|
|
|
|
|
Well if you don't want to get your credit card out of your pocket, then you will need to do what Christian has already stated.
|
|
|
|
|
Are u IT Professional.
If you can think then I Can.
|
|
|
|
|
Sorry for the slow reply but needed to go and do some of my own digging on the net.
To answer your question, NO, but you would never guess what i came across, something called google, it must be new, and using it i did work out that there are very few free linkers and obfuscators out there. I did find one though, although their free version is limited to what it can do, and is used via the command line.
I could keep looking for more, but like you I am also busy at work.
Anyway, i will let you get on now, you are obviously very busy trying to find a solution to your problem, and i wouldn't like to take up any more of your time.
Have a nice day
|
|
|
|
|
Actually you don't need to combine everything in one massive executable to make it portable, you just ensure you bundle all dependencies when deploying it to the portable device. .Net is great for that as you just copy the whole folder and ensure you have not coded against fixed paths.
http://portableapps.com/[^] has articles on making applications portable (sorry for no precise link but their site is down at this moment) , and includes a packaging tool.
It will work for .Net apps, however the guys at portableapps.com do not see .Net as a portable language due to the fact that (they say) less than 12% of windows machines can be relied on to have the correct version of the .Net framework, or even any framework. If you are developing in .Net 3.5 you would be really stuck for portability.
However in my experience .Net is reasonably portable.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Thank you sir, but at this time site is under contruction.
If you can think then I Can.
|
|
|
|
|
Well, you have several options
1 - get a grip. There's tons of apps that come with dlls, it's not a big deal
2 - pay for the application
3 - do it manually, as I explained
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
So here is my problem I am reading in a file containing data and then displaying that data into a listbox once a user clicks a button but I dont know what I am doing wrong or if I am leaving something out? I want the display the data as so:
99 100 33 88 11 58 23 55
10 23 15 16 23 100 10 94
AND SO ON
right now the code i am using is display my datain the list box like this
99 11 10 23
100 58 23 100
33 23 15 10
88 55 16 94
My text file that i am reading in is Comma delimited and I added a blank space for the first character as such:
,99, 100, 22, 88, 11, 58, and so on and so on.........
here is my code:
'variables needed to create and output file
Dim fileReader As StreamReader
Dim input As FileStream
Dim inputData As String
Dim count As Integer
input = New FileStream("cards.txt", FileMode.Open, FileAccess.Read)
'get file containing cards
fileReader = New StreamReader(input)
Dim cards(0 To 52) As String
inputData = fileReader.ReadLine()
cards = inputData.Split(","c)
For count = 0 To cards.Length - 1
'add user entered values to list box
lstCards.Items.Add(cards(count))
lstCards.ColumnWidth = 30
Next 'end for
|
|
|
|
|
I suspect the issue has to do with the way your control is set up to show data. I think the control shows data in columns, not in rows, and so your issue is not in your code, but in your expectations of how the control behaves.
You could set up a listview with 8 columns, then read your data 8 items at a time, and add rows that show data the way you want it to be seen. Of course then you won't have an item in the items collection for each number, if that matters.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
How to leave a complete row blank while filling the datagridview?
|
|
|
|
|
Insert a blank row in your datasource. Or don't use databinding and insert it ( and your data ) manually.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Can You pls write a piece of code on this?
|
|
|
|
|
i am trying to read all the data send from a device connected on serial port RS232 on my computer. this is only a part of a large project that i am working on. i want to capture all the data (text) from the device into a richtextbox. and after that to do somenting with the data.
but when i use the code below..... I get nothing.
<br />
Imports System<br />
Imports System.IO.Ports<br />
<br />
Public Class Form1<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
SerialPort1.Open()<br />
RichTextBox1.Text = ""<br />
RichTextBox1.Text = SerialPort1.ReadExisting()<br />
SerialPort1.Close()<br />
End Sub<br />
End Class
if instead of
RichTextBox1.Text = SerialPort1.ReadExisting()
' i use
RichTextBox1.Text = SerialPort1.ReadLine()
then i get only the first line of the data.
if i use hiperterminal the i gel all the data with function capture text. the data looks like this
110326+00000501 21.102+00000000 22.102+09017910 32..10+00000000
110327+00000502 21.102+36190750 22.102+09767930 32..10+00000000
But i get only the first line with my code, and after the first line on my device i receive RS232 error.
Can someone help me?
to receive data from device i run a program on device that send data to me and it's stops when the tranfer is completed.
|
|
|
|
|
Hi,
the documentation says:
- ReadExisting() reads all immediately available bytes
- ReadLine() reads up to the NewLine value in the input buffer
So the former will succeed if you call it AFTER the peripheral has sent all its data (how is your app going to know when the peripheral has sent it all?); and the latter needs a loop if you want to get more than one line.
Here are a couple of ways that would work:
- have a thread perform ReadLine() in a loop, and append each line to the RTB
- use the DataReceived event which could call ReadExisting, and append the result to the RTB
In almost all cases, you will have to be careful about this[^].
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Can you send me an example to look at? i am new in vb and i really want to make this program to work
|
|
|
|
|
Sorry, I'm a "software by documentation" adict, not a "software by example" dude.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
i search forum from examples but i did not find something to explicit to help. can you make some sugetions where to seek something or someone to explain step by step ?
thanks a lot for your help
|
|
|
|
|
When I search CodeProject with the keywords I provided earlier, I find several articles; the simplest is this one[^], however it is completely wrong about the cross-thread issue, you need to apply the link I provided.
Now go off and do your own research, I'm out of here.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Here is what i have used; you might what to strip out chunks of the code, and tweak the formatting though, as the code below populates a list box with a formatted byte dump, 16 Bytes wide and limits the number of rows added.
Place in the top of the class
Private WithEvents port As IO.Ports.SerialPort
I have this in a 'Connect' button, the combobox contains the list of enumerated serial ports e.g. COM1, COM2 etc.
Try
port = My.Computer.Ports.OpenSerialPort(ComboBoxSerialPorts.Items.Item(ComboBoxSerialPorts.SelectedIndex))
Catch ex As Exception
MsgBox("Error Opening Port: " + ex.Message)
End Try
I have this is a 'Disconnect' button
If port.IsOpen Then
port.Close()
Else
MsgBox("Port is already closed.")
End If
This is the part that handles the bytes coming in, and format it into the 16 Bytes line and populates a label with current 16byte chunk, and then adds a completed 16byte chunk to the listbox and limits the number of lines etc.
''' <summary>
''' Delegate Method for the Cross Thread calls
''' </summary>
''' <param name="byteRead">The byte read from the port</param>
''' <remarks></remarks>
Delegate Sub UpdateByteReadDelegate(ByVal byteRead As Byte)
Private Sub UpdateBytesRead(ByVal readbyte As Byte)
'Only Log if Enabled
If MenuLoggingDisplayRawEnable.Checked = False Then Exit Sub
Static counter As Byte = 0
Static currentLine As String = ""
If labelCurrentRawLogLine.InvokeRequired Then
Dim d As New UpdateByteReadDelegate(AddressOf UpdateBytesRead)
Me.Invoke(d, New Object() {readbyte})
Else
'
currentLine = currentLine & Format(readbyte, "X2") + " "
labelCurrentRawLogLine.Text = currentLine
counter += 1
'Do we need a line wrap?
If counter = 16 Then
'Add a new line and reset counter
If MenuLoggingDisplayRawEnable.Checked Then
'Make Room for the incoming raw bytes log
Dim trimSize As Integer
If (ListRawLog.ClientSize.Height / ListRawLog.ItemHeight) > My.Settings.LoggingDisplayRawMaxRows Then
trimSize = (ListRawLog.ClientSize.Height / ListRawLog.ItemHeight)
Else
trimSize = My.Settings.LoggingDisplayRawMaxRows
End If
ListRawLog.BeginUpdate()
If ListRawLog.Items.Count + 1 >= trimSize Then
Do Until ListRawLog.Items.Count + 1 < trimSize
ListRawLog.Items.RemoveAt(0)
Loop
End If
End If
'Add the new raw bytes log
ListRawLog.Items.Add(currentLine)
ListRawLog.TopIndex = ListRawLog.Items.Count - 1
ListRawLog.EndUpdate()
labelCurrentRawLogLine.Text = ""
currentLine = ""
counter = 0
End If
End If
End Sub
This is where the bytes are received by the app
Private Sub port_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles port.DataReceived
UpdateBytesRead(Format(port.ReadByte, "X2"))
End Sub
As i say you can do all the stripping out of all the formatting stuff etc.
|
|
|
|
|
i will try and let you know
|
|
|
|