So here is my problem
I have a program written in VB9 that I wanted to add a file reference to textfile renamed .spf.
In the file there is stuff on every row that the program does something about.
This is the info in the registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_RO OT\.spf]
@="Strukturprog ram.Document"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf]
@="Structurepro gram Import File"
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\De faultIcon]
@="C:\\Program\ \Heatex AB\\Strukturpro gram\\Strukturp rogram.exe,1"
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\Op en]
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\Op en\command]
@="C:\\Program\ \Heatex AB\\Strukturpro gram\\Strukturp rogram.exe%1"
And here is the code that doesent seem to work.
dblklicking a textfile.spf works fine and it opens the program.
the first msgbox shows a complete path to the file
but then I get an error saying that the path is not valid (Pasted the error on the bottom of this post)
inputName3 = Command()
MsgBox(inputNam e3)
Dim txt As String = My.Computer.Fil eSystem.ReadAll Text(inputName3 )
MsgBox(txt)
System.Argument Exception: Ogiltiga tecken i sökvägen.
vid System.IO.Path. CheckInvalidPat hChars(String path)
vid System.IO.Path. GetFileName(Str ing path)
vid System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
vid System.IO.Strea mReader..ctor(S tring path, Encoding encoding, Boolean detectEncodingF romByteOrderMar ks, Int32 bufferSize)
vid System.IO.Strea mReader..ctor(S tring path, Encoding encoding)
vid System.IO.File. ReadAllText(Str ing path, Encoding encoding)
vid Microsoft.Visua lBasic.MyServic es.FileSystemPr oxy.ReadAllText (String file)
vid Strukturprogram .Form1.Form_Loa d()
vid Strukturprogram .Form1._Lambda$ __1(Object a0, EventArgs a1)
vid System.EventHan dler.Invoke(Obj ect sender, EventArgs e)
vid System.Windows. Forms.Form.OnLo ad(EventArgs e)
vid System.Windows. Forms.Form.OnCr eateControl()
vid System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
vid System.Windows. Forms.Control.C reateControl()
vid System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
vid System.Windows. Forms.Control.W ndProc(Message& m)
vid System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
vid System.Windows. Forms.Container Control.WndProc (Message& m)
vid System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
vid System.Windows. Forms.Form.WndP roc(Message& m)
vid System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
vid System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
vid System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Inlästa sammansättninga r **************
mscorlib
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Strukturprogram
Sammansättnings version: 1.1.0.22
Win32-version: 1.1.0.0
CodeBase: file:///C:/Program/Heatex%20AB/Strukturprogram/Strukturprogram .exe
----------------------------------------
Microsoft.Visua lBasic
Sammansättnings version: 8.0.0.0
Win32-version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Visua lBasic/8.0.0.0__b03f5f 7f11d50a3a/Microsoft.Visua lBasic.dll
----------------------------------------
System
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c 561934e089/System.dll
----------------------------------------
System.Windows. Forms
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms/2.0.0.0__b77a5c 561934e089/System.Windows. Forms.dll
----------------------------------------
System.Drawing
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f 7f11d50a3a/System.Drawing. dll
----------------------------------------
System.Configur ation
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configur ation/2.0.0.0__b03f5f 7f11d50a3a/System.Configur ation.dll
----------------------------------------
System.Xml
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c 561934e089/System.Xml.dll
----------------------------------------
System.Runtime. Remoting
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime. Remoting/2.0.0.0__b77a5c 561934e089/System.Runtime. Remoting.dll
----------------------------------------
mscorlib.resour ces
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows. Forms.resources
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms.resources/2.0.0..0_sv_b77 a5c561934e089/System.Windows. Forms.resources .dll
I have a program written in VB9 that I wanted to add a file reference to textfile renamed .spf.
In the file there is stuff on every row that the program does something about.
This is the info in the registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_RO OT\.spf]
@="Strukturprog ram.Document"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf]
@="Structurepro gram Import File"
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\De faultIcon]
@="C:\\Program\ \Heatex AB\\Strukturpro gram\\Strukturp rogram.exe,1"
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\Op en]
[HKEY_CLASSES_RO OT\strukturprog ram.File.spf\Op en\command]
@="C:\\Program\ \Heatex AB\\Strukturpro gram\\Strukturp rogram.exe%1"
And here is the code that doesent seem to work.
dblklicking a textfile.spf works fine and it opens the program.
the first msgbox shows a complete path to the file
but then I get an error saying that the path is not valid (Pasted the error on the bottom of this post)
inputName3 = Command()
MsgBox(inputNam e3)
Dim txt As String = My.Computer.Fil eSystem.ReadAll Text(inputName3 )
MsgBox(txt)
System.Argument Exception: Ogiltiga tecken i sökvägen.
vid System.IO.Path. CheckInvalidPat hChars(String path)
vid System.IO.Path. GetFileName(Str ing path)
vid System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
vid System.IO.Strea mReader..ctor(S tring path, Encoding encoding, Boolean detectEncodingF romByteOrderMar ks, Int32 bufferSize)
vid System.IO.Strea mReader..ctor(S tring path, Encoding encoding)
vid System.IO.File. ReadAllText(Str ing path, Encoding encoding)
vid Microsoft.Visua lBasic.MyServic es.FileSystemPr oxy.ReadAllText (String file)
vid Strukturprogram .Form1.Form_Loa d()
vid Strukturprogram .Form1._Lambda$ __1(Object a0, EventArgs a1)
vid System.EventHan dler.Invoke(Obj ect sender, EventArgs e)
vid System.Windows. Forms.Form.OnLo ad(EventArgs e)
vid System.Windows. Forms.Form.OnCr eateControl()
vid System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
vid System.Windows. Forms.Control.C reateControl()
vid System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
vid System.Windows. Forms.Control.W ndProc(Message& m)
vid System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
vid System.Windows. Forms.Container Control.WndProc (Message& m)
vid System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
vid System.Windows. Forms.Form.WndP roc(Message& m)
vid System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
vid System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
vid System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Inlästa sammansättninga r **************
mscorlib
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Strukturprogram
Sammansättnings version: 1.1.0.22
Win32-version: 1.1.0.0
CodeBase: file:///C:/Program/Heatex%20AB/Strukturprogram/Strukturprogram .exe
----------------------------------------
Microsoft.Visua lBasic
Sammansättnings version: 8.0.0.0
Win32-version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Visua lBasic/8.0.0.0__b03f5f 7f11d50a3a/Microsoft.Visua lBasic.dll
----------------------------------------
System
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c 561934e089/System.dll
----------------------------------------
System.Windows. Forms
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms/2.0.0.0__b77a5c 561934e089/System.Windows. Forms.dll
----------------------------------------
System.Drawing
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f 7f11d50a3a/System.Drawing. dll
----------------------------------------
System.Configur ation
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configur ation/2.0.0.0__b03f5f 7f11d50a3a/System.Configur ation.dll
----------------------------------------
System.Xml
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c 561934e089/System.Xml.dll
----------------------------------------
System.Runtime. Remoting
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime. Remoting/2.0.0.0__b77a5c 561934e089/System.Runtime. Remoting.dll
----------------------------------------
mscorlib.resour ces
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows. Forms.resources
Sammansättnings version: 2.0.0.0
Win32-version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows. Forms.resources/2.0.0..0_sv_b77 a5c561934e089/System.Windows. Forms.resources .dll
Comment