473,221 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

easy app.config question

Hello All!

This seems pretty easy, but I'm missing something. In my app config file I
have
<add key="HL7File.Path" value="C:\Planes\STB" />

Then in my code I have below Windows Generated Code
Protected HL7File As String =
ConfigurationSettings.AppSettings("HL7File.Path")

Then when I need to call it.

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn.Click
Dim TimeStamp As String = Guid.NewGuid.GetHashCode
Dim TempFile As String = "HL7File.Path"
Dim ext As String = ".out"
Dim FileName As String = TempFile & TimeStamp & ext
Dim fs As New FileStream(FileName, FileMode.Create)
fs.Close()
File.Delete(FileName)
End Sub

I thought this would be pretty simple, what am I dong wrong? How can I call
that value back so I can use it?

TIA!

Rudy

Feb 6 '07 #1
2 1055
>This seems pretty easy, but I'm missing something. In my app config file I
>have
<add key="HL7File.Path" value="C:\Planes\STB" />

Then in my code I have below Windows Generated Code
Protected HL7File As String =
ConfigurationSettings.AppSettings("HL7File.Path ")

Then when I need to call it.

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn.Click
Dim TimeStamp As String = Guid.NewGuid.GetHashCode
Dim TempFile As String = "HL7File.Path"
Dim ext As String = ".out"
Dim FileName As String = TempFile & TimeStamp & ext
Dim fs As New FileStream(FileName, FileMode.Create)
fs.Close()
File.Delete(FileName)
End Sub

I thought this would be pretty simple, what am I dong wrong? How can I call
that value back so I can use it?
Well, you first read the value into your "HL7File" string, but then
you don't use that? Odd... :-)

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn.Click
Dim TimeStamp As String = Guid.NewGuid.GetHashCode

// no need for that -
// you've already read the value into "HL7File" !
-- Dim TempFile As String = "HL7File.Path"

Dim ext As String = ".out"

// use that "HL7File" variable you've set up !
Dim FileName As String = HL7File & TimeStamp & ext
Dim fs As New FileStream(FileName, FileMode.Create)
fs.Close()
File.Delete(FileName)
End Sub
HTH
Marc
Feb 6 '07 #2
Thanks Marc!

"Marc Scheuner" wrote:
This seems pretty easy, but I'm missing something. In my app config file I
have
<add key="HL7File.Path" value="C:\Planes\STB" />

Then in my code I have below Windows Generated Code
Protected HL7File As String =
ConfigurationSettings.AppSettings("HL7File.Path")

Then when I need to call it.

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn.Click
Dim TimeStamp As String = Guid.NewGuid.GetHashCode
Dim TempFile As String = "HL7File.Path"
Dim ext As String = ".out"
Dim FileName As String = TempFile & TimeStamp & ext
Dim fs As New FileStream(FileName, FileMode.Create)
fs.Close()
File.Delete(FileName)
End Sub

I thought this would be pretty simple, what am I dong wrong? How can I call
that value back so I can use it?

Well, you first read the value into your "HL7File" string, but then
you don't use that? Odd... :-)

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn.Click
Dim TimeStamp As String = Guid.NewGuid.GetHashCode

// no need for that -
// you've already read the value into "HL7File" !
-- Dim TempFile As String = "HL7File.Path"

Dim ext As String = ".out"

// use that "HL7File" variable you've set up !
Dim FileName As String = HL7File & TimeStamp & ext
Dim fs As New FileStream(FileName, FileMode.Create)
fs.Close()
File.Delete(FileName)
End Sub
HTH
Marc
Feb 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rich | last post by:
Hello, I picked up this example on using the Reflection namespace for loading forms/classes on the fly at msdn http://msdn.microsoft.com/library/default.asp?...
5
by: Dean Slindee | last post by:
I store several application settings in the project's "app.config" file. I also have a form that reads these values and displays them in a listview so that the user can adjust them. My question...
11
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand...
5
by: Keith | last post by:
Hello all, I have a C# Windows Forms app. It is in namespace App.GUI. It builds to Nav.exe. I have entered an application level setting using the designer. Its type is string, name is "FOO"...
5
by: mark_overstreet | last post by:
I have a generic data layer DLL that expects to read its connection string from it's own config file. The dll and config file have been placed in the bin directory (VS.NET2005). However, due to...
1
by: =?Utf-8?B?Y2FsZGVyYXJh?= | last post by:
Dear all, I am developing a multi tiers application and actually responsible of delivering the buines logic library. That buisnes logic library will need some parameters to be suitebale...
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
14
by: Naraendirakumar R.R. | last post by:
I have a client in the healthcare industry who would prefer to store the connection string in a centralized location in their Active Directory repository. Has anybody done this? What has your...
1
by: samadams_2006 | last post by:
Hello, I haven't done much programming in .asp and was wondering if someone could provide me with some sample code to do the following task... I have a Web Service called: ...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.