|
Oh, OK. YOu didn't make that clear. \" works, or if you use @ then "" works and \ otherwise means \. In a string like this:
"\\This\\is\\a\\string"
comes out as \This\is\a\string, because the \ is used as an escape character. If you put a @ at the front, then the \ just means \.
@"\This\is\a\string"
As you've been told, \" is how you specify quotes, quotes are the only thing that you can still specify in a @ string, with double quotes"
@"I have a single ""word"" in quotes"
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 )
|
|
|
|
|
sharpiesharpie wrote: i can't use IndexOf or any other function on it since it considers " a beginning of a string as a parameter
Yes, you can, you just don't know how.
To put a quote character in a string you use double quotes. This is a string that contains a single quote character: """"
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Sorry, I gave you a VB solution.
But it really felt like a VB question...
In C# you use \" to put a quote inside a string.
---
single minded; short sighted; long gone;
|
|
|
|
|
You need to use the special escape sequences to specify a quote. To remove a quote use the following, assuming their is a string 'This is a "quote"' assigned to the variable str.
You would declare it as:
String str="\'\"This is a \"quote\"\'";
int index=str.indexof("\"");
Other escape sequences that can be used:
\n - newline
\" - double quote
\\ - backslash
\b - backspace
\t - tab
\r - carriage return
\' - single quote
These escape sequences were taken from my AP Programming book specifc to java, but I know most of them work with .NET languages if not all of them.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thank you! works just perfect !
|
|
|
|
|
Hi there,
I am trying to implement the recurring billing in the pfpro_dotnet_sdk_RC2_v1.1. I am not sure how to do it.
I need some serious help from you guys about this.
My development environment is C#, VS 2005 and pfpro_dotnet_sdk_RC2_v1.1(verisign sdk).
Thanks in advance.
Regards
Nabhendu
|
|
|
|
|
Biplab saha wrote: I need some serious help from you guys about this.
Maybe if you detailed your problem, someone may be able to help you more.
However, this is not a PayPal support forum and PayPal have a support ticket system, online doccumentation, API reference and knowledge base.
This can all be found here: https://www.paypal.com/IntegrationCenter/ic_payflowsdk.html
With a community forum here: http://www.pdncommunity.com/
Not bad work considering I don't know anything about pfpro_dotnet_sdk_RC2_v1.1
The power of Google, you may want to try? --or-- at least post a question in the formum dedicated to the product
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hello,
how it is possible to register and then get the message WM_DWMWINDOWMAXIMIZEDCHANGE?
On http://blogs.msdn.com/greg_schechter/archive/2006/09/14/753605.aspx I have found this information:
WM_DWMWINDOWMAXIMIZEDCHANGE - windows can register to hear about when other windows have been maximized. This is useful for, for instance, the TaskBar or the SideBar which go opaque when other windows get maximized.
The following code will not detect the message WM_DWMWINDOWMAXIMIZEDCHANGE but the other messages like WM_DWMCOLORIZATIONCOLORCHANGED will be detected. (Desktop compositing is enabled and the following code is in a simple windows form created by vs2005)
private const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
private const int WM_DWMNCRENDERINGCHANGED = 0x031F;
private const int WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320;
private const int WM_DWMWINDOWMAXIMIZEDCHANGE = 0x0321;
protected override void WndProc(ref Message msg)
{
if (msg.Msg == WM_DWMWINDOWMAXIMIZEDCHANGE)
{
}
base.WndProc(ref msg);
}
May you have some information how register and detect this message...
Regards michi
-- modified at 6:35 Saturday 17th February, 2007
|
|
|
|
|
Im trying to take every pixel in a Bitmap and save it in bye array.... Buit Im getting a n error
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
Can any1 tell me wht wrong with this code
<br />
public static byte[] check(Bitmap b)<br />
{<br />
BitmapData bmData<br />
= b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly,PixelFormat.Format24bppRgb);<br />
int stride = bmData.Stride;<br />
byte[] bytes = new byte[stride * b.Height];<br />
System.IntPtr Scan0 = bmData.Scan0;<br />
unsafe<br />
{<br />
int a = 0;<br />
byte* p = (byte*)(void*)Scan0;<br />
int nOffset = stride - b.Width * 3;<br />
int nWidth = b.Width * 3;<br />
for (int y = 0; y < b.Height; ++y)<br />
{<br />
for (int x = 0; x < nWidth; ++x)<br />
{<br />
<br />
bytes[a] = p[0];<br />
a++;<br />
Here I got the error-> bytes[a] = p[1];<br />
a++;<br />
bytes[a] = p[2];<br />
a++;<br />
p += 3;<br />
<br />
}<br />
p += nOffset;<br />
}<br />
}<br />
b.UnlockBits(bmData);<br />
return bytes;<br />
}<br />
<br />
|
|
|
|
|
Read my image processing articles. You're stepping over the scanline into the stride area.
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 )
|
|
|
|
|
How about using serialisation? You could even use this to store practiaclly any object into a database.
Try this:
1) Create a new windows form app
2) Add to the form 2x picture boxes, one named source, the other dest
3) Add a new button named serialise
4) Set the background image of the picturebox named source to whatever you want (for testing, do this using the designer)
5) Add a handler to the buttons click event (this normally happens automatically if you double click the button in the designer)
6) Add using System.Runtime.Serialization.Formatters.Binary; declaration to your class
7) Paste the following code:
void SerialiseClick(object sender, EventArgs e)
{
byte[] byteArray = Serialise( source.BackgroundImage );
dest.BackgroundImage = (System.Drawing.Image)Deserialise(byteArray);
}
public static byte[] Serialise( object obj )
{
System.IO.MemoryStream ms = new System.IO.MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize( ms, obj );
return ms.ToArray();
}
public static object Deserialise( byte[] obj )
{
System.IO.MemoryStream ms = new System.IO.MemoryStream( obj );
BinaryFormatter bf = new BinaryFormatter();
return bf.Deserialize(ms) ;
}
There is also Image.FromStream method which could be used instead and probably other ways of achieving a similar result.
Feel free to download the sample code I wrote from here: http://www.box.net/public/14kiat6na7
I love serialisation
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
How to drag a line from one to another point.
Exp. from (10, 40) to (80, 90).
Help.
In VS 2003.
C#
|
|
|
|
|
draw it, or drag it ?
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 )
|
|
|
|
|
You may track the mouse movement, but this will cause you a refresh and redraw to the line every small pixels.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Well, a friend requested an application, and I've been working on it. And it requires detecting and accessing a USB flash drive.
I looked in the article:
http://www.codeproject.com/dotnet/devicevolumemonitor.asp
I am not using it with a USB Flash Drive right now, just CDs. Well, I'm having an issue. When I insert a CD (drive D: OR E , I get this:
Volume inserted in
No drive letter. But when I eject the CD, it says:
Volume removed from D:/E:
Whichever drive I put the CD in. Could someone else try it out and try to find what's going wrong. I didn't modify the code. I simple downloaded the source code, and built it.
I'm on Windows 2000 Pro Service Pack 4, and VS .NET 2005 Pro. I also tried it on VS .NET 2003 Pro.
Thanks in Advance,
Matt U.
|
|
|
|
|
Ok i have created my first quality application for windows, a Puzzle game and i am planning on giving out a test version to my friends so that any errors found can be fixed. I have added a Rich text box to the app and i want the text that is input into it saved. i know this involves databases and the book i have on C# is very unclear about anything to do with data bases. So i need to know how to create a database and how save the text to it and have it recalled when it loads i know this is alot of work but any help would be much appreciated.
|
|
|
|
|
Why use DB, you may use files, easier, faster, and helpful, you may use System.IO for it, its very easy,
If you are considering files then take a look at TextWriter and TextReader classes of the IO namespace .
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
i keeping getting an error message stating "Unrecognized escape sequence" when i tell it what file to read any ideas why or how to fix it?
|
|
|
|
|
Use @ infront of the string like
string path = @"mtapp\mypath\";
|
|
|
|
|
Hi,
I desperatelly need an answer on my probably dumb question .
I use data bound DataGridView control and I need (on click of the button) to programmatically add row. When I use command DataGridView1.Rows.Add() I get message: "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.". How can I trigger event that causes to create new row?
Thanks,
Aleks
|
|
|
|
|
Add a row to the datatable that is the source, and remove it later.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
So simple and so smart. Thanks a lot.
|
|
|
|
|
I am currently trying to build a serial monitoring program.
I am planning on using several ChildMDI forms to hold data grids with decoded serial data. I built an event driven serial driver, and when a packet is received, an event is fired. From that eventhandler, I am trying to call methods within the ChildMDI forms to update their data. When the event fires, everything is executed, except the calls to the ChildMDI forms. Its as if the calls are never made (I have tried one of the methods I wrote, and just using .Close() to no avail). I have verified the methods work by inserting a test button and have gotten the Child forms to respond to that. Is this something that just won't work, or do I need to configure it in a special way?
Thanks!
-- modified at 15:15 Friday 16th February, 2007
|
|
|
|
|
I have an application that frequently modifies the values of certain strings that are attributes of some classes that I use in the application. These strings get modified once every 1-4 minutes during normal software operation. Would the StringBuilder class provide any performance enhancement over a String in this situation?
Thanks.
|
|
|
|