|
No need, it was indeed just a wrong bracket error, which i noticed once you suggested it.
Sods Law.
The code you gave me works perfectly
Very much appreciated
|
|
|
|
|
string fileName = DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".txt";
fileName = Application.StartupPath + "\\" + fileName;
StreamWriter sw = new StreamWriter(fileName);
sw.WriteLine("Some Data");
sw.Close();
...hope this helps you
EDIT: Error with code block formatting???
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: Error with code block formatting???
Could it be that the colourer ignores the \\ and therefore sees a \" which means the string isn't closed?
|
|
|
|
|
Yeah, I assume it just does a last character check and does not check the \ if that is the last character
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thanks
Seems to function exactly how i was wanting it to
Very much appreciated
|
|
|
|
|
Yeah, the "t" in the format is interpreted as a request for "am" or "pm" as appropriate; so in the afternoon, you get "pxp", in the morning you'd get "axa".
In the future you could try "yyyyMMdd_hhmmss.'txt'" .
Oh, and use HH to get 24-hour time.
modified on Thursday, August 27, 2009 3:19 PM
|
|
|
|
|
Ahhhh, thankyou.
All seems much clearer now.
Thanks for the extra tip too
|
|
|
|
|
|
hi guys
i have a grid in whihc i have two columns these are check box columns
now i want to iterate all the rows of grid and to perform some action but only if one of the two check box columns is active or checked else i am skipping the current row
i am doing the floowing but it is not working correctly
(!(Convert.ToBoolean(ugrRow.Cells["Add to device "].Value)) && Convert.ToBoolean(ugrRow.Cells["Discard"].Value)))
continue;
else
{perform logic here .}
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
try this...
if((bool)ugrRow.Cells["Add to device "].Value || (bool)ugrRow.Cells["Disgard"].Value)
{
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
How to pass apostrophe to .Trim() Method ?
It is working
sValues.Trim(',')
But here is problem
sValues.Trim(''')
|
|
|
|
|
|
hii...
i enter value in textbox which is number eg:1001
now i want to convert this into string.like:
one thousand and one.
how can i do it using csharp...
reply....
|
|
|
|
|
easy...
int number = 1001;
switch(number)
{
case 0:
return "zero";
case 1:
return "one";
case 1001:
return "one thousand and one";
}
... No, I'm joking. But not far off, have a look at this[^]
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
http://www.blackwasp.co.uk/NumberToWords.aspx
Please refer this site easy for you.
|
|
|
|
|
Very useful, I'll keep it in mind if I ever need to use it
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Ah, so you get paid by the number of lines of code...
|
|
|
|
|
I wish, because then I would be intentionally making the most inefficient programs ever!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
That's a homework problem that shows up here many times at this time of year; you can search.
|
|
|
|
|
Hey, this is fairly simply question, I believe, just something very new to me.
I recently downloaded an SDK and want to access it with my c# console. I cannot seem to find it in my COM references??
My actual aim is to use the ConvertStringSidToSid function call
http://msdn.microsoft.com/en-us/library/aa376399%28VS.85%29.aspx[^]
Which is apparently is in the SDDL.h header.
I'm trying to add the SDK reference but it doesn't appear in the list of COMS. Any help for going about this would be brilliant.
Thanks you
|
|
|
|
|
|
Wow. can't believe I hadn't come across that site. I now have to issues. I have tried two of the approaches mentioned.
<pre>//SecurityIdentifier is defined in the System.Security.Principal namespace.
SecurityIdentifier si = new SecurityIdentifier(sidBytes, 0);
return si.ToString();</pre>
runs into the error stating "SIDs with revision other than '1' are not supported.Parameter name: binaryForm"
When trying to compile the function which includes
<pre>finally
{
LocalFree(ptrSid);
}
return sidString; </pre>
I cannot find the LocalFree function, what object does it belong in?
Many Thanks
|
|
|
|
|
|
public static string GetSidString(byte[] sid)
{
IntPtr ptrSid;
string sidString;
if (!ConvertSidToStringSid(sid, out ptrSid))
throw new System.ComponentModel.Win32Exception();
try
{
At the !ConvertSidToString, I am getting the error "The security ID structure is invalid"
I'm trying all 3 functions now. I'm getting the error from my previous post, the error above and the 3rd function, the very long one on pinvoke.net gives the same result "S-0-0x2x2x2x2x2x2x" every time.
I only need one to work!! 3 functions and they all have problems.
Thanks for the help so far.
|
|
|
|
|