|
A List<ToolStripItem> works fine.
|
|
|
|
|
hi,
by default the configuration file should be located where the 'exe' file is and the name should end with '[applicationname].config'
how can i specify if the location of the config file is somewhere else?
regards,
rnv
|
|
|
|
|
|
Hi all !
I search the way to capture events on my shared folders.Like the mmc Shared folders.
I'm interesting by session connection/disconnection events or open file events...
If somebody can help me ...
Thanks in advance
PS : Sorry for my bad english
|
|
|
|
|
I'm trying to set things up so that multiple users can access a shared file, but only the first to open the file can get write privlages (the remainder are limited to readonly access).
I'm trying to use the FileSHare property to do this without success. What I tried doing was having the
app first try to open it with FileAccess.ReadWrite and FileShare.Read privlages, and if that failed in with FileAccess.Read FileShare.Read for read only acccess.
What I've discovered is that if the first user has the file open, the 2nd+ users fail due to a permissions failure. I don't understand why though, the first user's allowing readshare privs, and the 2nd is only attempting to open it for read access.
|
|
|
|
|
Good morning!
Have a try with this code. Run it simultaneously on a file whose path you set in the variable path .
string path = @"C:\A\Path\To\A\File\moo.txt";
System.IO.FileStream fs = null;
Exception me = null;
try
{
fs = new System.IO.FileStream( path,
System.IO.FileMode.Open,
System.IO.FileAccess.ReadWrite,
System.IO.FileShare.Read );
}
catch( Exception )
{
try
{
fs = System.IO.File.Open( path,
System.IO.FileMode.Open,
System.IO.FileAccess.Read,
System.IO.FileShare.ReadWrite );
}
catch( Exception e )
{
me = e;
}
}
finally
{
if( me != null )
{
Console.WriteLine( "Error: " + me.Message );
System.Threading.Thread.Sleep( 10000 );
}
else
{
Console.WriteLine( "Read: " + fs.CanRead + Environment.NewLine +
"Write: " + fs.CanWrite );
System.Threading.Thread.Sleep( 10000 );
fs.Close();
}
}
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
-- modified at 11:34 Thursday 8th December, 2005
|
|
|
|
|
|
I truly hope that it helps.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
i need a help using crystal.net with c#.net
here is my problem: i want to use TOP N propriety in code on c#.net, but i just know how to do it on crystal, can anybody help me ?
tks
|
|
|
|
|
horacyjr wrote: i want to use TOP N propriety in code on c#.net, but i just know how to do it on crystal, can anybody help me ?
TOP N? In C#? I think you are getting confused with SQL.
In SQL you can do something like this:
SELECT TOP 10 * FROM MyTable
If this is not what you are looking for please clarify your request.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
In Sql server, you can specify "N" dynamically but you have to use dynamic query.
|
|
|
|
|
Only for SQL Server 2000. In SQL Server 2005 you can specify N with a variable.
SELECT TOP @numRows * FROM MyTable
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
|
|
this was the answwer , thanks for helping
http://msdn.microsoft.com/library/default.asp?url=/library/en-s/crystlrf/html/crlrftopbottomnsortfieldclasstopic.asp
private TopBottomNSortField GetTopBottomNSortField
(int sortFieldIndex)
{
TopBottomNSortField topBottomNSortField;
// Get the SortField object by index, cast it as a
// TopBottomNSortField object, and return it.
topBottomNSortField =
Report.DataDefinition.SortFields[sortFieldIndex]
as TopBottomNSortField;
if (topBottomNSortField != null) return topBottomNSortField;
else return null;
}
|
|
|
|
|
Hello. I want to do something like this:
float number = 3 / 2;
The problem is that the decimals don't show up, all that is displayed is "1" instead of 1.5. I have tried using float/double/decimal but still the decimals disappear.
What's wrong? Am I missing something here?
|
|
|
|
|
I think you are.
In this expression, the numbers 3 and 2 are integers. If you integer divide 3 by 2 you get 1. This 1 is converted to a float implicitly because no data is lost, but it's not the value you are looking for.
Try:
float number = 3.0 / 2.0;
Regards,
Rob Philpott.
|
|
|
|
|
I have a custom title bar that I simply made from a label. My form is fixeddialog so I can get that raised effect. Everything looks great until I minimize my form to the taskbar. When I do this, I only see the corresponding icon and not the text. This is because my borderstyle isn't "none." And to have a fixeddialog form without a titlebar, you must make the text "". Therefore, I came up with this: When I minimize my form, I change the borderstyle and text so that it appears in the taskbar. The trick now is to get it to restore without the Titlebar. Essentially, I just need to do the opposite of what I did when I minimized the form.
So, my question, do I have access to the "restore" event handler that is called when you either click or right-click on the item in the taskbar? If not, does anyone have another solution to this problem? Thanks in advance.
|
|
|
|
|
Look at the Resize and SizeChanged events of the form, at least one of them's fired by a resize, although I'm not sure which.
|
|
|
|
|
Thanks Dan,
I tried that and it works. However, it flickers quite a bit. Too much to be acceptable. Any ideas? Thanks again.
|
|
|
|
|
Not really. there're properties to enable double buffering, but apparently they only work on custom controls and not an entire form. Doing manual resizing for a complex form I was able to largely reduce the flicker by massaging my code to use anchoring and nesting groups of controls in groupboxes as much as possible, and trying different ways to resize/position an object, there didn't appear to be any logic behind why X worked better than Y on control type A, while for B's you wanted to use Y instead.
|
|
|
|
|
Thanks for looking out. I just assumed that there would possibly be some win32 API that I could override to manually put the text in the taskbar.
|
|
|
|
|
Simply import the user32 dll and call the SetWindowText() method.
using System.Runtime.InteropServices;
[DllImport("User32.dll")]
public static extern int SetWindowText(IntPtr hwnd , string str);
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
SetWindowText(this.Handle , "Title");
}
Thanks again for your help.
|
|
|
|
|
Hi guys,
I've posted about this in a slightly different way in the SQL Server forum, but have had a bit of progress since then.
I have created an asymm key on the SQL server and can extract the public keys from the server using the following sql statement
select public_key from sys.asymmetric_keys
public key seems to be a 148 bit hex value.
How do i create an RSAParameters from this value?
TIA
Russell
|
|
|
|
|
Can this be done without attempting to open a file first? I can to the try catch route if not, but would prefer something more graceful.
|
|
|
|