|
Escape the double quote:
s = "this \" is a double quote";
or
s = @"this "" is a double quote";
|
|
|
|
|
Thanks Corinna.
Mazy
No sig. available now.
|
|
|
|
|
\" perhaps?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Yes.
Mazy
No sig. available now.
|
|
|
|
|
|
I saw a lot of datagrid messages but still remain a few questions for me:
1. there is a simple way to know if the grid was edited or not (= any cell changed, deleted, added or not)
2. I want a grid that is not readonly but allows just update or update and delete but no insert, ...
3. want to scroll down: when the grid is show the last lines be visible
4. a kind of alternate color: change rows background upon a cell value (have more records for a day and I want to have rows for same day in same color, changing background for the next day)
Thanks
|
|
|
|
|
Anyone have any experience with used the FileSystemWatcher in conjunction with FTP?
Trying to processing incoming files at are being dropped into a given directory via FTP, but don't want to start processing until the FTP process has *completed* writing the file to disk.
Any ideas? The NotifyFilters don't seem to allow for the "close" on the file.
TIA.
~Mike Stanbrook
|
|
|
|
|
Ok, I've gotten around the problem by attempting to open exclusively, and sleep until successful.
However, for large files, I still get 3+ "Changed" events thrown.. anyone have a good scheme for blocking/ignoring the extraneous events ?
TIA.
~Mike Stanbrook
|
|
|
|
|
Hello all. I'm trying to do some tag swapping and having no success. My tags come in the following format: <#data>.
The data can be letters, numbers or spaces. My colleague here at work wrote the following:
<#([^>])>
This seems to match everything fine but I'm using a CodeProject tool called <a href="http://www.codeproject.com/dotnet/Expresso.asp ">Expresso</a>[<a target=_blank title='New Window' href="http://www.codeproject.com/dotnet/Expresso.asp ">^</a>]and the match occurs only for the first character. Is there a way to make it recursively grab all the characters in between tags?
I tried this with groups and was very frustrated:
<#(?<data>([^>]+)>
It still only seems to grab the first character.
Thanks in advance...
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
|
|
lets say i execute a command line operation like this
Process cmd = null;
ProcessStartInfo options = new ProcessStartInfo(fileName, arguments);
options.UseShellExecute = true;
options.WindowStyle = ProcessWindowStyle.Normal;
cmd = Process.Start(options);
cmd.WaitForExit();
it could be a ping or anything, how can i capture the output of that instruction?
Thanks in advance
|
|
|
|
|
Set options.RedirectStandardOutput to true then you can do something like string stdout = cmd.StandardOutput.ReadToEnd() (which should come before you WaitForExit()). The problem I have is that I can't get at the StandardOutput before the process exits, so if you manage to figure that out, please let me know!
|
|
|
|
|
http://www.codeproject.com/csharp/LaunchProcess.asp
That article was exactly what I needed, but I'm not sure if that would work for anyone else
|
|
|
|
|
I've been using a number of third party COM components with VC6 and now that I am migrating to C# I beginning to dive into Interop. The manufacturer of these components won't support .Net and have no intention of migrating in the near future so I am creating wrappers for the components in question. The tlbimp utility fails with a number of errors when converting the type libraries so I am creating the wrappers by hand. So far so good - sort of. I've gotten a number of the functions in a number of the components to be accessible, my problem is finding the right data type to marshal the data as. For instance:
typedef StructList __RPC_FAR *RCStructList;
typedef struct tagSTRUCT1
{
long nVal1;
long nVal2;
double dVal1;
} Struct1;
typedef struct tagSTRUCT2
{
Struct1 S1;
Struct1 S2;
} Struct2;
struct StructNode{
Struct2 __RPC_FAR *pNext;
StructNode node;
};
struct StructList
{
StructNode __RPC_FAR *pFrst;
};
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE
GetList(
/* [in] */ RCStructList rslRequested,
/* [in] */ DWORD dwMin,
/* [in] */ DWORD dwMax,
/* [retval][out] */ StructList rslFetched
) = 0;
OK, so, I converted the first two structures like this:
public struct Struct1
{
public Int32 nVal1;
public Int32 nVal2;
public double dVal1;
}
public struct Struct2
{
Struct1 S1;
Struct1 S2;
}
It seems to work alright. So what do I do about the other two and the function call? And what happens when one of the parameters is a BSTR pointer? I've tried the UnmanagedType.BSTR to no avail, it just keeps throwing a null reference exception. On another note, I've been able to wrap the function calls alright except when the return [retval] is an interface. I use
[return: MarshalAs(UnmanagedType.Interface)] Object func_call();
But it throws an exception saying there's no such interface.
Thank you in advance for any assistance you may provide.
|
|
|
|
|
IntPtr works for all pointer types.
I think you can convert this one
struct StructNode{
Struct2 __RPC_FAR *pNext;
StructNode node;
};
like that
public struct StructNode{
IntPtr next;
IntPtr node
}
You can convert structures with Marshal.StructureToPtr() and re-convert them with Marshal.PtrToStructure().
|
|
|
|
|
I have heard that the ability exists to write Windows application in .NET that will self upgrade (do a version check on startup and silently pull down updates from a server). I suppose that ability exists in any environment if you put enough effort into it, but I was hoping there were some built-in API calls that could be made and a standard mechanism to do this. Has anyone done anything along these lines and can point me to a document or code example. Thank you.
Ron Ward
|
|
|
|
|
Have a look at the App Updater Application Block from MS here[^].
I haven't used it, but HTH.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG picture :: my first abstract photo
|
|
|
|
|
Thanks Simon. That was the exact article I was looking for.
|
|
|
|
|
Hi,
Can any 1 tell me how I can access COM ports in C#
I'm making a semester project that checks if my Mouse/KBoard etc are plugged in or any Errorz etc occur.
Plz Help
Raheela
|
|
|
|
|
Is there any equivilent in C# of the following C++ construct:
struct Data
{
int val;
char* pStr;
};
Data data[] =
{
{ 0, "Zero" },
{ 1, "One" },
{ -1, NULL }
};
I tried the following, and a few variations, but they didn't work:
public struct Data
{
public int val;
public string str;
};
static public Data data[] =
{
{ 0, "Zero" },
{ 1, "One" },
{ -1, NULL }
};
The following works, but it really bugs me:
public struct Data
{
public int val;
public string str;
public Data(int v, string s) { val = v; str = s; }
};
static public Data data[] =
{
new Data(0, "Zero"),
new Data(1, "One" ),
new Data(-1, NULL )
};
Am I missing something?
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
|
jparsons wrote:
What bothers you about this?
For years I programmed in assembly. Ever since part of my brain is always thinking about what is really happening "underneath." I'm not well versed with how ILASM and how .NET actually does certain things. The construct I used looks inefficient, even though it very well may be.
Joe Woodbury
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
Well...
<br />
static public Data data[] = {<br />
new Data(0, "Zero"),<br />
new Data(1, "One" ),<br />
new Data(-1, NULL )};<br />
In a sense, it's the only logical thing to do (and allow)..
After all, in C# arrays are actually a type of their own
(unlike the older C style case where an array is just a
pointer).
So, while the first line begins the instanciation of a new
Array of Data, you still have to instanciate and initialize
each data (hence the other lines look like they do).
The longer version of the same code is (forgetting about static and public):
<br />
Data[] data = new Data[3];<br />
data[0] = new Data(0, "Zero");<br />
data[1] = new Data(1, "One");<br />
data[2] = new Data(-1, NULL);<br />
Until the second line, data[0] has not been instanciated to be
a Data object (yet, data[] has been instanciated to be an array of
Data objects that can accomodate 3 Data instances).
Might seem inefficient, but, thinking of the Data instances as objects
of their own right, it makes sense (sort-of)...
..sure, in your case they are structs, but I think that at this point they
just figured it was better to avoid a different syntax for structs vs classes...
I saw this situation in Java the first time,
and it took a bit to get used to it (yeah, I kept on thinking that
after Data[] data = new Data[3] all three data objects where instanciated,
pointing to NULL... again, they are not pointers!).
F.O.R.
|
|
|
|
|
I'm actually not sure what happens in this case. Your data type is a struct so it's a value type. Typically value types are allocated on the stack instead of the heap. However, you're array is most likely (please correct me if I'm wrong here) is a reference type and will be allocated on the heap. So I'm not sure exactly where the value types memory will be allocated.
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|