-
- A conversion question.
by AlexBB
- 2 Replies
- Last post
by AlexBB
- What is the inverse for the operation below if I want to get back an array of byte[]:
byte [] cipherText
string str1 = Convert . ToBase64String ( cipherText ) );
cipherText = Convert.
Thanks.
-
- How to check whether the system is 32 bit or 64 bit ?
by Kulvinder
- 8 Replies
- Last post
by Kulvinder
- Hi,
I want to know programmatically whether the system is 32 bit or 64 bit in C#. My program has been compiled for 32 bit for sure but it is not working on 64 bit, so i need to put some checks.
Can someone help
I have seen the post in MSDN blogs itself but couldnt find it working for C#.
Thanks in advance.
Kulvinder Singh
-
- web.config file references assemblies, but on build machine the do not live in GAC, only in a harvested dir
by Dan D
- 2 Replies
- Last post
by TaylorMichaelL
- Here when we do builds on our development machines we are having no problems building our .NET (2.0) app which has a web.config file with references to assemblies, and these assmeblies exist in the GAC on our development machines. When we do builds though, it is on a build system who's GAC does not contain all of the assemblies. The files associated with the assemblies are actually pulled into a h
-
- Help me a problem in webservice
by Khieu Trung Son
- 1 Replies
- Last post
by Alberto Poblacion
- In my webservice, has a private prop is ArrayList _arrPro, two methods are addCart() and getCart(). In my asp.net page, i make a instance of webservice named is cart. i used cart.addCart(_cart) - type of _cart is Ecart a owned class).i call cart.addCart(_cart) for 3 times but _arrPro has not change.pls.
-
- Start Processes and monitor it.
by MielieSpoor
- 6 Replies
- Last post
by MielieSpoor
- Good evening,
I need to start a process from my C# app. I know I can use the process.start() method but the problem is that I need to know when that process has finished executing so that I can continue.
I need to know what the result was of the process so that I can determine what the next step should be. (I need to run installer files (msi's)).
Any ideas
-
- Make an Enumeration of Times (00:00 to 23:30)
by PlaTyPuS8
- 8 Replies
- Last post
by decyclone
- Hi!
How can I do that I want to put these Times in a combobox....
Thx for help!!
PlaTyPuS
-
- Declaring multiple randoms in the same block results in the same pattern of numbers. Can I get around this?
by Oneiros
- 4 Replies
- Last post
by JohnWein
- I've been toying around with Randoms for some time now, and have noted that if I declare several Randoms like so:
Code Snippet
MersenneTwister d1 = new MersenneTwister(); MersenneTwister d2 = new MersenneTwister(); MersenneTwister d3 = new MersenneTwister(); The results for each one [d*.Next()] invariably results in the exact same number. I've created a class for a game I am worki
-
- Functional Constraints?
by Kris Ganjam
- 10 Replies
- Last post
by Nimrand
- I want to be able to write a templatized function that works for string and char[] and my custom StringExtent which maintains a string as {char[], start and length}.
void f<T> (T t)
{
for (int i = 0; i < t.Length; i++) { char c = t[ i ]; }
}
Is there any way to get this to work in C# so that t[ i ] will get inlined My guess is that abstract base class or interf
-
- Windows Service with Timer ?
by Jarod.Net
- 8 Replies
- Last post
by Kusala
- Hi
I tried to use timer with windows service but it seems that Timer is disposed after some time. So another achiving the same would be using while(true) thread. sleep(x) but where to put Thread.Sleep If I will put in the OnStart and Sleep is like one hour it will never start actually. So what's the best choice
Jarod
-
- Language suggestion: try using {} catch {} finally {}
by sholodak
- 14 Replies
- Last post
by sholodak
- I would like to recommend adding a 'try using' statement. It would make code easier to read and would limit horizontal scrolling in cases of nested using statements. Also, it is easier to understand that the catch statement outside the using statement is fired only if the variable initialization fails. The alternative (wrapping a using statement in a try statement) leads to more ambiguous-looking
-
- namespace overlap
by MuscleHead
- 2 Replies
- Last post
by frederikm
- Hi,
Let's say assembly 1 has a namespace a.b
Another assembly 2 has a namespace c.a.d
('a' just happens to be the same word, but conceptually the two namespaces are different.)
In assembly 2 (i.e., within the block
namespace c.a.d { }
) how do I reference the namespace in assembly 1
Is there a way to tell the compiler that when I say a.b, I want that to be within the global na
-
- usage of Threads
by ugp
- 5 Replies
- Last post
by OmegaMan
- there are 2 methods in a program...(say method1 and method2 are in the same file)
how can i run those 2 methods in 2 different threads
Code Snippet
public class Class1{
public void method1(int i,int j){
//do something
}
public void method2(String sj){
//do something
}
}
These 2 methods need to be run
-
- Building in "default" references for intellisense
by Boaz Leskes
- 0 Replies
- Last post
by Boaz Leskes
- We are using runtime compilation to support "script like" files where are loaded and compiled by our application at runtime (using the C# CodeDomeProvider). In the meantime we have accumulated quite a lot of these scripts files and we spent a lot of time writing code in them. Naturally have intellisense work in them would save up a lot of time. Is there any way to tell VS intellisen
-
- NEED A REALLY, REALLY SIMPLE CHAT-TYPE PROGRAM!!
by xlthim
- 14 Replies
- Last post
by Pace
- OK - I've been all over the web for the past couple of hours looking for a program, but nothing is fitting what I need.....
I have 2 computers. On one (server), I press a button and a string is generated. I need to get this string to the other computer (client) via networking so the client will do something.
Every program I have looked at seems like I have to have a 3rd computer to be the se
-
- does managed code take precedence over native code?
by nattylife
- 5 Replies
- Last post
by nattylife
- i wrote a small demo C app that sends a message and a struct to a managed C++ dll. this C++ dll marshalls over the message and struct to a managed struct and sends it to a C# assembly that just prints out the values of the struct (to see that everything came over ok) and sends back a string reply, it also prints some debug text to console. before the call to the C++ dll, i make a few calls to prin
-
- Why Override and not New ?
by Navdeep
- 3 Replies
- Last post
by Eugene Dolinskyy
- Why don't we "New" the function during inheritance if we know binding ( early or late ) is not an issue. Usually override is the commonly used. We know Override is a case of polymorphism and New is for Data hiding. What is the difference between Override and New in practical scenario. Consider a code below the New will yield similar result instead of Override.
Code Block pub
-
- HelloWorld help required!
by littlenewbie123
- 2 Replies
- Last post
by jgalley
- Hi,
I was just making my HelloWorld program in C# when i thought i'd have a little play about and clone an old gag where you cant actually press the control button!
For this i have a mouseEnter event and this flawed code:
button1.Location.X = 120;
and the error is
Error 1 Cannot modify the return value of 'System.Windows.Forms.Control.Location' because it is not
-
- Using Visual C# code in Visual Web Developer Express Edition
by Kirk Evans
- 5 Replies
- Last post
by Harsimrat
- for aspx development, I'm using Visual Web Developer Express Edition.
Is there any way to share classes that I develop in Visual C# in Web Developer
I know I can copy *.cs files to the "App_Code" folder, but I would prefer to have them both using the same file ( a la "add as link" ).
Also, when I *do* copy classes to the "App_Code" folder, the web site runs f
-
- Hi, I need help in C#
by Titus2go
- 5 Replies
- Last post
by Titus2go
- Hi, everyone I am Titus Cheng. I am currently facing a problem that I still can't solve. I want to wrap tags around SelectedText in Rich Text Box Control. I am not trying to use html tags, but whehter contextual tags. For example if I select the word "glass" and change the font of the text to red, it will appear like "[red]glass[/red]" and if I change the text to bold, it will
-
- launch an urgent email using URI?
by o00oo00o
- 4 Replies
- Last post
by Peter Ritchie
- Hi,
I know how to launch the editor using Process.Start() and the "mailto:..." but how to make the email to be in urgent state
Thanks,
Max
-
- Generic type parameter constraint is not enforced correctly
by Escape
- 6 Replies
- Last post
by Escape
- or at least it doesn't seems...
Hello,
I'm working on a weird but really usefull design that allows to write static methods in generic type using the type parameter. The type parameter is then infered, so the FxCop team told me it was a design that could bypass the DoNotDeclareStaticMembersOnGene ricTypes rule.
To make it more understandable, here is a short code sample :
 
-
- Property abstraction with differing get/set interfaces
by tomc_bc556789
- 10 Replies
- Last post
by CommonGenius.com
- I am trying to implement two interfaces and associated abstract classes that imlpement the following pattern: A given property has only a get accessor in the base interface/class, while the derived interface/class 'adds on' the set accessor. Below is an example of the code that I would like to use.
Code Snippet
public interface IBase { int Property { get; } } public abstract class Ba
-
- Strange problem seen at runtime.
by Sabrecat
- 4 Replies
- Last post
by Sabrecat
- All,
Im not sure if this is the correct forum for this post but I am hoping that someone here has seen this problem before. This is becoming a real serious issue for me and I am hoping that the solution isnt "re-install" VS 2005.
When I create a project now in C# I am getting this error at run time.
" Could not find any resources appropriate for the specified cu
-
- Active Directory - How to search users, how to know a user exists or not?
by Praveen battula
- 2 Replies
- Last post
by Praveen battula
- i wrote a method to create account in active directory, but my problem is if a user is already exists, i like to check, so here i need search i used DirectorySearcher class, by setting Filter property i implemented my code. in filter property i set it like searcher.Filter = "(&(objectClass=user) (cn=" + userName + "))"; is this the right Format if yes... there are no resu
-
- object reference not set to an instance of an object
by Latheesan
- 4 Replies
- Last post
by Latheesan
- Hello, Im trying to workout how to dynamically add tab pages with RichTextBox inside them. So far: 1. I have a form with a input field to enter how many tab pages to create 2. A button that calls the method to create tab page when clicked 3. a tabcontrol with no pages on it Here is a demo - http://img525.imageshack.us/img525/4519/untitledxv6.jpg This is the code i have on form1.cs
static in