473,811 Members | 3,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange character problem

Eps
My program has an ini file which i read in the settings for the program.
The main setting is the path where files are to be saved. At the
moment it doesn't work, but if I hardcode the path it does (even though
the hardcoded path is the same as the one in the ini file).

I looked at the path in a text box after it had been read in and it had
a strange character on the end, it was a slim upright rectangle, i
assume this is the source of my problem. Anyone know how I can read in
the string without this character ?

Any help appreciated.

--
Eps

http://ukcomment.blogspot.com/

A UK political Blog
Nov 17 '05 #1
4 1774
Eps,

In the debugger, I would check the length of the string, and find out
the value of that character. It is possible that there is some whitespace
or non printable character that is in the file.

In either case, you can trim off the whitespace or non printable
character, or modify the file (I'd cut it out and retype the path in the ini
file).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Eps" <ep*@mailinator .com> wrote in message
news:d3******** **@domitilla.ai oe.org...
My program has an ini file which i read in the settings for the program.
The main setting is the path where files are to be saved. At the moment
it doesn't work, but if I hardcode the path it does (even though the
hardcoded path is the same as the one in the ini file).

I looked at the path in a text box after it had been read in and it had a
strange character on the end, it was a slim upright rectangle, i assume
this is the source of my problem. Anyone know how I can read in the
string without this character ?

Any help appreciated.

--
Eps

http://ukcomment.blogspot.com/

A UK political Blog

Nov 17 '05 #2
Eps
Nicholas Paldino [.NET/C# MVP] wrote:
Eps,

In the debugger, I would check the length of the string, and find out
the value of that character.


I'm using visual c# 2005 express, how can i view the contents of a
varible when the program is running ?

--
Eps

http://ukcomment.blogspot.com/

A UK political Blog
Nov 17 '05 #3
The cheap and nasty way is to do this:

Console.WriteLi ne("Character code is: {0}",
(int)problemStr ing[problemString.L ength - 1]);

this will print out the character code as an integer. You can then look
it up in an ASCII table.

Nov 17 '05 #4
Eps
Bruce Wood wrote:
The cheap and nasty way is to do this:

Console.WriteLi ne("Character code is: {0}",
(int)problemStr ing[problemString.L ength - 1]);

this will print out the character code as an integer. You can then look
it up in an ASCII table.


thanks for everyones help, turns out using the Trim method sorted it.

--
Eps

http://ukcomment.blogspot.com/

A UK political Blog
Nov 17 '05 #5

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

Similar topics

6
2252
by: Anders Eriksson | last post by:
Hello! I'm using ActivePython 2.3.2 build 232 on Windows 2000 and I have noticed a strange behavior in PythonWin IDE (win32all build 163) I'm from Sweden and we have a couple of letters in our alphabet that isn't part of ASCII and the strangeness is about one of them When I use the letter å (&aring;) then the next character is eaten! Then when I enter the next character (the second after å) the last one appears.
4
1467
by: Tomasz Lisowski | last post by:
Hi, We are distributing our Python application as the short main script (.py file) and a set of modules compiled to the .pyc files. So far, we have always treated .pyc files as portable between platforms, but recently we have discovered an annoying problem. In a module, there is the following code fragment: Deg2Rad = math.pi/180.0 angleEPS = 0.5
6
9408
by: Sam Sungshik Kong | last post by:
Hello! I'm testing Graphics.DrawString and it's very strange. I created an event handler for the form.s Paint event. (There's no other code in the form.) private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics;
7
1430
by: Tina | last post by:
I'm using 1.1/vs.net 2003 ... C#example.............. string myPath = Server.MapPath(".\\Data\\" + (string) Session); Produces this value in myPath ?myPath
14
3363
by: blumen | last post by:
Hi all, I'm a newbie in VB.Net Programming.. Hope that some of you can help me to solve this.. I'm working out to read,parse and save textfile into SQL Server. The textfile contains thousands of rows with about 50 coloums every row.. Everythings goes well until I found one textfile with some strange character...seems to be Japanese character(because it's a Japanese company who owns this textfile)
1
2752
by: Mark Morss | last post by:
Is this the place to ask a win32com.client question? I am a unix person trying to run on windows, so I have little familiarity with this module. I have this code: import win32com.client """An Access connection""" def connect(data_source, user, pwd, mdw): connAccess = win32com.client.Dispatch(r'ADODB.Connection')
4
1449
by: ZuLuuuuuu | last post by:
Hello, I have a strange problem or the problem is very obvious and I can't see it :) I'm kind of a new C programmer so the chance of the latter is more :) Anyway, I have a structure like this: #define EN_COK_HECE 40 struct kel { char kelime; char sesliHarfler;
7
2086
by: email7373388 | last post by:
I'm working on a program which has a strange operator, :>. This is the syntax: ((unsigned short)( var1)):>((void __near *)( var2 )) Any clue?
5
2437
by: ioni | last post by:
Good day, fellows! I have a strange problem – at my site there is a flash strip, that loads data dynamically. It works fine (grabs data from the remote server and presents it), however in IE7 and its clones I encounter a strange problem where I can hear clicking sound non-stop (like the page is being reloaded non- stop), whereas the page is not reloading.
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.