By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

Application only crashes on a few system

P: n/a
Hi all,

I have created a VB.net application using:
Microsoft Development Environment 2002 Version 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705

The application was working fine in one system but crashes on the other.
1) Functioning PC
OS :Window XP service pack 1, Version 1 (Build 2600.xpsp2.030422-1633)
..Net : Version V1.1.4322

2) Not Functioning PC
OS :Window XP service pack 1, Version 1 (Build 2600.xpsp2_gdr.040517-1325)
..Net : Version V1.1.4322

Any suggestion on what could be the problem?
What other information do I need to pinpoint where could be the problem?
Is it because of the XP service pack version? I can find any information
regarding the different build information.

Thanks,
Wong

Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
The error msg is as follows:

System.IO.IOException: Bad file name or number
at Microsoft.VisualBasic.FileSystem.PrintLine(Int32 FileNumber, Object[]
Output)
at FileComparator.Selection.Button_start_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
..........
"Wong_wj" wrote:
Hi all,

I have created a VB.net application using:
Microsoft Development Environment 2002 Version 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705

The application was working fine in one system but crashes on the other.
1) Functioning PC
OS :Window XP service pack 1, Version 1 (Build 2600.xpsp2.030422-1633)
.Net : Version V1.1.4322

2) Not Functioning PC
OS :Window XP service pack 1, Version 1 (Build 2600.xpsp2_gdr.040517-1325)
.Net : Version V1.1.4322

Any suggestion on what could be the problem?
What other information do I need to pinpoint where could be the problem?
Is it because of the XP service pack version? I can find any information
regarding the different build information.

Thanks,
Wong

Nov 21 '05 #2

P: n/a
Wong,

The only thing I can come up from this information and because of the
different versions, (I don't know if that is for language types), that it
can be that the computers have different country settings and that you have
hard coded stringsformat which you use as filenames.

However can maybe show the code where that io operation is done where it
crashes?

Cor
Nov 21 '05 #3

P: n/a
Hi Cor,

Thanks for the reply.
Here are some of the codes which might be causing the problem.

Private Sub Button_start_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button_start.Click
Dim filename, filename2 As String
Dim file1, file2 As String
Dim startcheck As Boolean

startcheck = False
totError = 0

filename = TextBox_file1.Text
filename2 = TextBox_file2.Text
file1name = extractFilename(filename)
file2name = extractFilename(filename2)

If selectType = 1 Then
saveFilename = UDFolder + "\" + file1name + "_NCZvsNCZ.rep"
startcheck = startError()

If startcheck Then
'Header
FileSystem.PrintLine(1,
"************************************************" )
FileSystem.PrintLine(1, " NCZ vs NCZ Comparison")
FileSystem.PrintLine(1, " " + file1name + ".NCZ vs " +
file2name + ".NCZ Comparison")
FileSystem.PrintLine(1, " " & Date.Now.ToString())
FileSystem.PrintLine(1,
"************************************************" )
FileSystem.PrintLine(1, "")
FileSystem.PrintLine(1, "")

'Open and Sort file
Try
OpenSortNCZ(filename, 1)
OpenSortNCZ(filename2, 2)
Catch
MsgBox("Critical Error during opening file!",
MsgBoxStyle.Critical)
End
End Try

'Checking both file
Try
checkNCZVsNCZ()
Catch
MsgBox("Critical Error during checking file!",
MsgBoxStyle.Critical)
End
End Try
End If
............
End Sub

Public Function extractFilename(ByVal filename As String) As String
Dim strFullPathToFileName As String
Dim strPath As String
Dim strFileName As String
Dim backslashPos As Integer

'delete away \ path
strFullPathToFileName = filename
backslashPos = InStrRev(strFullPathToFileName, "\")
If backslashPos > 0 Then
strPath = Microsoft.VisualBasic.Left(strFullPathToFileName,
backslashPos)
strFileName = Mid(strFullPathToFileName, backslashPos + 1)
Else
strPath = ""
strFileName = strFullPathToFileName
End If

'delete away ext
strFileName = Microsoft.VisualBasic.Left(strFileName,
InStrRev(strFileName, ".") - 1)

'MsgBox(strFileName)
Return strFileName

End Function

Hope this helps.....
"Cor Ligthert" wrote:
Wong,

The only thing I can come up from this information and because of the
different versions, (I don't know if that is for language types), that it
can be that the computers have different country settings and that you have
hard coded stringsformat which you use as filenames.

However can maybe show the code where that io operation is done where it
crashes?

Cor

Nov 21 '05 #4

P: n/a
Wong,

I don't see directly what can be the error, however one thing I see is that
you use some dangerous code in the part where it goes wrong by using the +
as concatenator instead from the &. This can give errors in some situation.

As well would I use the streamwriter in your situation, not that it helps,
however makes it in my opinion more readable.

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps anyhow,

Cor
Nov 21 '05 #5

P: n/a
"Wong_wj" <Wo****@discussions.microsoft.com> schrieb:
Public Function extractFilename(ByVal filename As String) As String


You may want to use 'System.IO.Path.GetFileName' instead of your
implementation. (This won't solve the problem.)

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.