|
This code is way too messy, the string.Replace method will do this much nicer.
What's the error you're getting, and what's the filename ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi,
i am giving file name as G&avi this is in somevariable var1;
forexch(char c in var1)
{
switch(c)
{
strifn newname="";
case '&':
newname=var1.replace("&","&");
break;
}
}
(i am replacing a & with @amp;)
)
|
|
|
|
|
71 wrote: forexch(char c in var1)
{
switch(c)
{
strifn newname="";
case '&':
newname=var1.replace("&","&");
break;
This is ridiculous. All you need is the replace statement ( although this particular one does nothing, it replaces & with &.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
<company>
<employee name="Prasad&Hiremath">
o/p:
Error wright
<company>
<employee name="Prasad&Hiremath">
o/p:prasad&hiremath
i want like this pls
*/
hi i have placede xml codes it is not shown here
|
|
|
|
|
hi,
but how can I handle those extra chracters like
if & replace with &
if " replace with "
help me pls
|
|
|
|
|
That is fine but my question is why do you want to store a file name with special character as most of OS doesn't allow that !!!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
hi,
foreach (char c in FileName)
{
switch (c)
{
case '&':
FileName = FileName.Replace("&", "&");
//"<","&"
break;
case '>':
FileName = FileName.Replace(">", ">");
break;
case '<':
FileName = FileName.Replace("<", "<");
break;
case '"':
FileName = FileName.Replace("\"", """);
break;
case ' ':
FileName = FileName.Replace(" ", " ");
break;
case '@':
FileName = FileName.Replace("@", "@at");
break;
see the code i am replacing the exttra charcters like this but still i am gettign error.
|
|
|
|
|
OK - this code is way too messy and shouldn't be used. More importantly, you are replacing illegal characters with illegal characters. For instance, you are replacing an & with an & - consider replacing it with a space or an empty string or even an underscore.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi,
since i am pasting the xml code u are not able to see it i am replacing
[""""& with [&""""]'
e.g: & with """"&"""
foreach (char c in FileName)
{
switch (c)
{
case '&':
FileName = FileName.Replace("&", "&");
break;
case '>':
FileName = FileName.Replace(">", ">");
break;
case '<':
FileName = FileName.Replace("<", "<");
break;
case '"':
FileName = FileName.Replace("\"", """);
break;
case ' ':
FileName = FileName.Replace(" ", " ");
break;
case '@':
FileName = FileName.Replace("@", "@at");
break;
}
}
|
|
|
|
|
I have a feeling that this needs some thinking as special character with special character could lead to some unknown exceptions !!!
I have another question why you want to use replace then ?
Let me get back to you !!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
hi,
sicne i am placing the xml code u r not able to see it.
this is my gmail :prasad.gch71@gmail.com
can u come online
or say me how can i place the HTMl codes on this forum.
i am pasting but it is not visible for u.
|
|
|
|
|
I don't have gmail talk, you can send mails to my personal id mentioned in my signature. We can discuss it in mails ok
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
hi,
pls check the mail i have sent the code.
|
|
|
|
|
Hi I have replied you to your personal id.
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
Hey while trying to solve you query I came across this link, I hope this will help you to achieve the same
http://support.microsoft.com/kb/316063
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
i need a keyword at c# as (exit) at (VB.net)
123
|
|
|
|
|
return;
But, it's generally better to write functions with one exit point.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
How can i communicate between to exe files.
Well basically i am using STAF tool i.e. software testing automation framework to hold the communication .
But i am not getting how to communicate back to the exe.
Like a.exe in server machine starts b.exe in client machine. Now b.exe should go back to a.exe to ask which task to implement and now a.exe says run calc.exe and therefore b.exe should executed dt. i can do one way communication or even two way but i cant communicate with the exe..i dont want to run the whole exe while back communication i.e b.exe to a.exe.
Any ideas
Thanks
|
|
|
|
|
If it's client/server, you need TCP/IP or something. If they are on the one machine, you can get by with WM_COPYDATA
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Basically its a peer to peer network using STAF tool.
SO what option gonna be best for this.. what about semaphore and queue.
I dont know much about it and also there is no much help from googles for a STAF tool.So lil stucked at the moment
thanks
|
|
|
|
|
hi...
how can i create a conference using text in c#?
plz help me,it is urgent
|
|
|
|
|
|
I suspect you're asking how to write a program like MSN Messenger ? How can that be urgent ?
As someone said, everything about how you went about this has tended towards a situation where no-one can help you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, I would like to know the diffenrce between vb.net and c#.net based on oops. What are there in vb.net or not there c#.net or vice versa.
thanx,
yamini
|
|
|
|
|
"Oops" is what you say when you do something like accidentally deleting a weeks worth of work. Needless to say, "oops" should always be avoided.
I suppose that you are more interrested in OOP; object oriented programming.
Both VB.NET and C# are fully object oriented (as opposed to for example C++ and Delphi, which are procedural languages with OOP support). When it comes to OOP, there is no difference in what you can do with VB.NET and C#. The both compile into IL code and use the same framework, so the resulting code is quite similar.
---
single minded; short sighted; long gone;
|
|
|
|