-
- Change resolution
by Angel Kafazov
- 1 Replies
- Last post
by Mattias Sjogren
- To change the resolution you can call the ChangeDisplaySettingsEx Windows API, I don't know if it is exposed in .NET.
-
- GUID for a User
by carrics3
- 5 Replies
- Last post
by carrics3
- Can anyone tell me the line of code to retrieve the logged in users GUID in C#
I know its only a line of code...I had it...But lost all my work this morning
Anyone able to help me.
Thanks.
-
- NTFS Folder Permission (UserGroup)
by jen28756
- 1 Replies
- Last post
by Tom Meschter MSFT
- Hi all,
I need to provide for the user group(full control access) for a given folder. I am able to give full control access for a user using ADSI but not for a user group..
Check my code below,
public static bool GrantPermission(String vPath, String UserName ) { try { ADsSecurity objADsSec; SecurityDescriptor objSecDes; AccessControlList objDAcl; AccessControlEntry objAce1;
-
- foreach without Type
by Ori'
- 9 Replies
- Last post
by James Curran
- Hello,
I have a collection and I want to iterate all elements in it. Example:
string [] arr = new string [] { "A" , "B" , "C" };
foreach ( string s in arr)
Console .WriteLine(s);
in the example the element type is string, because the collection is array of strings.
is there a way to do the same as foreach does, but without declaring th
-
- Retrieve username for logging
by pcvodak
- 2 Replies
- Last post
by OmegaMan
- OK let me reword this:
I've written application that will be used on system that has a local user logged in to the system. Remote user will use secure PCAnywhere. I want to capture the PCAnywhere username that connects to the system not the local username. I have events logging to a custom log in the event viewer and that's where I planed to place the username information as well.
I
-
- How to capture Electronic Signature using C#
by Radhakrishnan.Ramanujam
- 2 Replies
- Last post
by Brazzle
- Hi All,
Using C# :
The forms need to be designed in such a way that it allows capturing of the signature.
Depending on the purpose of the form after capturing the signature, one of the
following may need happening.
The data are stored in the system The data are e-mailed to someone The data are printed.
Please help me to go ahead for this requirement..
I am
-
- current stacktrace - programmatically?
by arro239
- 3 Replies
- Last post
by arro239
- how do i get current stacktrace programmatically
i've tried taking a StackTrace from exception but it was not full stack but a relative stacktrace of one method :(
public static string getStackTrace()
{
try
{
throw new Exception ();
}
catch ( Exception e)
{
return e.StackTrace.ToString();
}
}
-
- Compiler Optimizations Wreaking Havoc
by Chuck S.
- 7 Replies
- Last post
by Chuck S.
- C#, VS2005
The application works as expected in Debug configuration, but the Release configuration is wonky when compiled with optimizations turned on (default). The issue is that this is a rather long development cycle application and most of it was developed in Debug configuration. As a check, I ran it in Release and it no longer functions well.
Now, I haven't dug too deeply into
-
- enums, ints and strings
by Snickel65
- 4 Replies
- Last post
by PJ. van de Sande
- Is there any way to convert an int value into a string representing an enum value
enum ViewMode { View Mode0, ViewMode1, ViewMode2,
ViewMode(n) };
int vm = 2;
txtViewMode.Text = ... {turn vm into a string, "ViewMode2"}
Can this be done
-
- Getting Monday date in week
by Ric Bevan
- 1 Replies
- Last post
by TaylorMichaelL
- I am wanting to find the date of a Monday of any week. So, if I specified Thur 22nd March (22/03/2007) it would return 19/03/2007. Can anyone help
-
- I need help configuring DirectCast in C#.
by ajm113
- 10 Replies
- Last post
by ajm113
- Error 6 'System.Windows.Forms.RichTextBox' does not contain a definition for 'FindControl'
Code Block
RichTextBox t = (RichTextBox)Form.FindControl("newRtb"); Isn't that is how it should be set up Here is a list of names I am using for my application that works with the function. Window = Form Of The App newRtb = The RichTextBox - A am creating multiable textb
-
- Default File Properties
by Jeff Levinson
- 1 Replies
- Last post
by Chris Brandsma
- Okay, apparently there aren't a lot of people who need to do this or maybe they just haven't thought about it.
When I add a file to VS (Add Existing Item or even New Item) default values are populated for Build Action, Copy To Output Directory, etc. These are different depending on the file extension. The question is, how do I add settings for a specific file type. The situation here is tha
-
- Converting into decimal
by Codeme
- 6 Replies
- Last post
by TilakGopi
- Hello Members, I want the value to be converted into decimal. SqlConnection cnn = GetNewConnection(); //The below one is the SQL function I am executing . SqlCommand cmd = new SqlCommand("SELECT dbo.Calc(1, 18, 4) as totalCost ",cnn); object result = cmd.ExecuteScalar(); decimal (cost)=decimal (result); Please tell me , why the value in result is not showing the same in cost.Its shows me
-
- Creating code at runtime
by Oscarfh
- 1 Replies
- Last post
by Oscarfh
- Hi,
I'm studying to my certification exam and I've got some problems.
I'm trying to generate code at rutime, the books says that I can create a constructor this way:
//typeBldr is a typebuilder already defined
ConstructorBuilder constr = typeBldr.DefineDefaultConstructor( MethodAttributes .Public);
ILGenerator codeGen = constr.GetILGenerator();
codeGen.Emit( OpCodes .Ret);
-
- userControl question
by ashk1860
- 2 Replies
- Last post
by Figo Fei - MSFT
- hi
I have created a userControl with several properties and I have all of them in properties panel. how can I make groups and order them in groups
-
- inlining compareTo(int a,intb) { return a-b; }
by Itai Frenkel
- 13 Replies
- Last post
by Itai Frenkel
- Hello,
I am writing a class that implements the IDictionary<TKey,TValue> interface and it extensivly needs to compare two "TKey" types. (using Microsoft Visual C# 2008 Beta 2)
The problem is that the resulting assembly code in the common case, in which TKey is an integer is far from being optimized, and it is definitly not inlined (checked the release code after disab
-
- why is this statement not working?
by cheatcountry
- 14 Replies
- Last post
by Sharad Nair
- What I am trying to do in this code is if the user clicks the checkbox (default is to be unchecked), then it will stay checked when the user goes back to this window. My code is below: private void frmPreferences_Load(object sender, EventArgs e) { // Attempt to open the key RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\\Franklin's Stock Project\\Preferences&quo
-
- Variable import problems
by dudearcher
- 14 Replies
- Last post
by dudearcher
- I am a noob, and I am having a problem with variables in my progect. When I import them to another namespace it throws and exception about endless loops. Please help!!
-
- Assigning lot's of string into an array after it has been declared
by learning33
- 7 Replies
- Last post
by Figo Fei - MSFT
- I want to declare a class variable "plant" with 150 slots. I want to do this on a global( ) level in my class so I can use the variable anywhere. Then later in the code, in a method, I want to put 150 strings into these slots. I know I can do this by using: private string[] plant = new string [150]; and later: hand[0] = "ek"; hand[1] = "bok"; ... and so on
-
- Inline method in C# !!!
by gr_arm
- 9 Replies
- Last post
by Peter Ritchie
-
- Converting from IntPrt to int32[]
by rockeye
- 12 Replies
- Last post
by HWM
- Hi, I am a newb in c# and I am trying to convert an array pointed by an IntPtr ip to an Int32[] data WITHOUT copy. I have tried Marshal.PtrToStructure(ip, data), but it raises an Argument exception because data seems to be unblittable but this http://msdn2.microsoft.com/en-us/library/75dwhxf7(VS.80).aspx tell the contrary. I found a lot of threads for converting Array in IntPtr, using a fixed blo
-
- Database Scripts
by help_eachother
- 14 Replies
- Last post
by Ji Cheng Wang - MSFT
- Hi,
I want to run some database scripts before and after running NUnit tests.
I am thinking of creating a seperate project for these scripts and then i can call this exectable assembly before and after NUnit tests
Kindly guide me , if this approach correct.
Should i create a database projects or a normal project
-
- obtaining the index of a checkbox from inside an event
by christopherbouy
- 3 Replies
- Last post
by christopherbouy
- Quick Question I have an array of checkboxes,(not a checkbox list), created at runtime and inserted in a panel. Upon creation, they're each attached to the same CheckChanged event. Within this event, how do I know the index of the checkbox that triggered it Thanks in advance.
-
- How to use logical 'AND' ?
by mshvw
- 3 Replies
- Last post
by Figo Fei - MSFT
- Hello,
I would like to execute a logical 'AND' on two byte types by:
byte b1,b2,b3;
b3 = b1 & b2;
but I get a compiler error that 'byte' cannot be used with logical '&' operator....
neither can 'char' not 'int'...
How do I logical 'AND' two data types
regards,
Henk
-
- Angle between two lines
by Seif Ibrahim
- 4 Replies
- Last post
by Paul R. Elliott
- Hey,
I have a coordinates of two lines, lets say :
Line1: (x1, y1), (x2, y2)
Line2: (x3, y3), (x4, y4)
Is there a function in C# that calculate the angle between this two lines
Thanks in advance.