Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
AnswerRe: local/global variables? Pin
Gary Thom10-Sep-04 6:10
Gary Thom10-Sep-04 6:10 
GeneralRe: local/global variables? Pin
Heks10-Sep-04 6:52
Heks10-Sep-04 6:52 
GeneralRe: local/global variables? Pin
Gary Thom10-Sep-04 13:16
Gary Thom10-Sep-04 13:16 
GeneralRe: local/global variables? Pin
Heks10-Sep-04 15:05
Heks10-Sep-04 15:05 
GeneralRe: local/global variables? Pin
Gary Thom11-Sep-04 1:32
Gary Thom11-Sep-04 1:32 
Generaltext files, WinME Pin
Pensioner10-Sep-04 4:55
Pensioner10-Sep-04 4:55 
GeneralRe: text files, WinME Pin
Heath Stewart10-Sep-04 6:50
protectorHeath Stewart10-Sep-04 6:50 
GeneralRe: text files, WinME Pin
Pensioner11-Sep-04 1:35
Pensioner11-Sep-04 1:35 
Thanks Heath - I hadn't met the 'in code' use of 'using', and will (later) amend my code - your comments are 100% accepted. However, I believe that there is an underlying problem. The program is a Windows Executable, and is installed to c:\newbak in windows ME. I run the program from the desktop shortcut set up (correctly) by the install. The code used to invoke the file write is in only one place:
string workdir = System.IO.Directory.GetCurrentDirectory();
tempcfg.tofile(workdir + "\\newbak.cfg");
I changed to use the explicit path when I got my problem - in .net debug, it works perfectly with the default! I accept that there is a better way to code the file write, but the .net calls were lifted from a SAMS VB .net 2003, and I assume that an explicit streamwriter close would include a flush. That the code behaves strangely:

If c:\newbak\newbak.cfg exists, 'renames' it to .old and then creates a new c:\newbak\newbak.cfg (as expected).
If c:\newbak\newbak.cfg DOESN'T exist, it writes c:\windows\temporary internet files\newbak.cfg.

The only differencein the code flow is that the 'rename' code is not executed in the second case.

My 40 years in IT, and my not having gainful employment at present, means I will continue to convince myself the .NET is better than Borland C++ Builder (garlic out now!), and re-run with messageboxes at strategic locations. Of course, I have PROBABLY done something stupid and if so I will own up. Any other advice gratefully received.

Thanks again
Graham

66 year young - or old and past it whichever! c# newbie.
GeneralRe: text files, WinME Pin
Heath Stewart11-Sep-04 16:01
protectorHeath Stewart11-Sep-04 16:01 
GeneralRe: text files, WinME Pin
Pensioner11-Sep-04 21:00
Pensioner11-Sep-04 21:00 
GeneralRe: text files, WinME Pin
Pensioner23-Sep-04 5:34
Pensioner23-Sep-04 5:34 
GeneralDataGrid VSrollBar Does't work Pin
Steve4510-Sep-04 4:26
Steve4510-Sep-04 4:26 
GeneralCatch a Disconnect event in Client-Server Socket enviroment Pin
Gian10-Sep-04 4:24
Gian10-Sep-04 4:24 
GeneralRe: Catch a Disconnect event in Client-Server Socket enviroment Pin
Dave Kreskowiak10-Sep-04 6:53
mveDave Kreskowiak10-Sep-04 6:53 
Generalhelp in windows services Pin
jacal9910-Sep-04 2:48
jacal9910-Sep-04 2:48 
GeneralRe: help in windows services Pin
Dave Kreskowiak10-Sep-04 4:40
mveDave Kreskowiak10-Sep-04 4:40 
GeneralRe: help in windows services Pin
SandeepN10-Sep-04 10:40
SandeepN10-Sep-04 10:40 
GeneralRe: help in windows services Pin
jacal9910-Sep-04 10:57
jacal9910-Sep-04 10:57 
GeneralTime EventHandler Pin
brunoconde10-Sep-04 2:18
brunoconde10-Sep-04 2:18 
GeneralRe: Time EventHandler Pin
Stefan Troschuetz10-Sep-04 2:30
Stefan Troschuetz10-Sep-04 2:30 
GeneralRe: Time EventHandler Pin
mav.northwind10-Sep-04 2:53
mav.northwind10-Sep-04 2:53 
GeneralRe: Time EventHandler Pin
brunoconde10-Sep-04 5:00
brunoconde10-Sep-04 5:00 
GeneralRe: Time EventHandler Pin
mav.northwind10-Sep-04 5:16
mav.northwind10-Sep-04 5:16 
GeneralUpgrade to Windows Installer 2.0 using the C# setup projects Pin
samirazmat10-Sep-04 2:07
samirazmat10-Sep-04 2:07 
GeneralRe: Upgrade to Windows Installer 2.0 using the C# setup projects Pin
Mike Dimmick10-Sep-04 3:09
Mike Dimmick10-Sep-04 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.