-
- DateTime resolution
by Avi120
- 3 Replies
- Last post
by Rory (Clissold Solutions)
- Hi all,
Consider the code below:
DateTime now = DateTime .Now;
Thread.Sleep(10);
DateTime now2 = DateTime .Now;
now.AddMilliseconds(-now.Millisecond)
now2.AddMilliseconds(-now2.Millisecond)
bool b = now == now2 // it is always false
Why when I set the millisecond part in both variables to 0 they are still not identical (tick different ). How can
-
- Can't track down or reproduce ArgumentOutOfRangeException
by jongas
- 1 Replies
- Last post
by TaylorMichaelL
- Hi,
I've got this unhandled error from a user. Is there a way to track down where the error occured based on this info. I've got other threads accessing comboxes, but they are all checking for
if (AnyComboBox.InvokeRequired) ComboBox.BeginInvoke(( MethodInvoker ) delegate...
Anyone had the same happened to them or any suggestions how to approach this I can't really reproduce this error
-
- 'System.OutOf MemoryException' - Please help
by polachan
- 11 Replies
- Last post
by Peter Ritchie
- Dear Sir ...Please help
Please help for the following error 'System.OutOf MemoryException' was thrown.
I given the following code to read a text file . But the above error mesage is coming
System.Text.StringBuilder sb = new System.Text.StringBuilder();
using (FileStream fs = new FileStream(FileName , FileMode.Open, FileAccess.Read))
{
using (FileStream fs2 =
-
- Why is this not valid!!!???
by DotNetTex
- 6 Replies
- Last post
by DotNetTex
- I have a question that nobody in my department is able to answer. It came to me while using the Class Designer to stub out our data access layer of our application. The question is:
If I create an abstract worker class as such:
public abstract class MyClass
{
public abstract void MyMethod( DataEntityAbstract Entity);
}
Then try the following in its deri
-
- Is it possible to find the time taken to run the project file?
by Prabu.
- 5 Replies
- Last post
by Prabu.
- How can I find an exact timing taken for run the project files I am using devenv.exe to run the application. I need to hold the till the project gets run. Here is the code I had tried. Please help.
foreach ( FileInfo file in d.GetFiles ( ¡°*.csproj¡± ) )
{
string Arg = string .Format ( "\"{0}\" /run /out \"{1}\"" , file.FullName, d.FullName + "\devenv.log" );
Process p =
-
- encryption problem
by dabd
- 5 Replies
- Last post
by AlexBB
- I have the following code which I would like to use to encript a password. However, I get a 'Specified key is not a valid size for this algorithm.' error on the line that is marked below. How can I solve it= thanks private const string keyString = "193-155-298-97-284-58-100-241"; public static string CreateCipher(string s) { //DES cipher = new DESCryptoServiceProvider(
-
- converting values--need help
by rookie_rockie
- 6 Replies
- Last post
by rookie_rockie
- hi i have some queries 1)i have a string(not hexadecimal ) and i want to convert it to a (string )hexadecimal 2) after that i want to store it in a byte[]-- have tried getByte() for 1) i have tried
string hex = "7B" ; // must be hexadecimal for it to work
int myInt = Convert .ToInt32(hex, 16);
Console .WriteLine( "{0}" ,myInt);
for 2)
-
- threads
by mallamahesh
- 8 Replies
- Last post
by Matthew Watson
- I have problem in executing a method having more than 1 argument through threads. The scenario is :
I'm creating a thread inside a FOR loop. So according to number of iterations, respective number of threads will be created.
I'm creating thread and passing a method as :
Thread thrd1 = new Thread1(delegate() { SampleMethod(int a , int b) ;} );
thrd1.Start();
Ex :
-
- Difficult one, using methods in switch statements...
by PeteDemotedIn6Months
- 5 Replies
- Last post
by Matthew Watson
- Could anyone help me with this please ...
I have the condition...
if (compareString.IndexOf( "<USERID>" ) != -1) //if USERID is contained within 'comparestring'...
{
}
and i want to use a switch statement instead but cant use a method within the variable that im switching (hope this makes sense....) this is what I have tried....
swit
-
- "Type Variables"?
by ThiagoPadilha
- 6 Replies
- Last post
by ThiagoPadilha
- i wonder if there is a kind of variable that stores types , my trouble is that i am trying to define a class that when instanciated will contain a datatable object, but i dont want it to the of the generic system.data.datatable, i want it to be one of the tables defined in my typed dataset automatically created by Visual studio data source configuration wizard.
ex:
i have a table in my d
-
- Help with generics
by Victor_Acosta
- 8 Replies
- Last post
by Victor_Acosta
- Help with generic types.
Scenario
I am creating an instance of a collection in that way:
RegionCollection myregioncollection = new RegionCollection ().Load();
Then I am saving the object into a session to allow other web pages recover the object and then perform some actions.
Session[¡°mycollection¡±]= myregioncollection;
NOW I am
-
- Calling unmanaged objects!!
by TheMaj0r
- 4 Replies
- Last post
by TheMaj0r
- Hello,
I got a library that is unmanaged and not a member of the COM interface. I tried to add reference to it in VS but it cannot be imported.
The library class is object oriented like the following:
public class movie
{
public movie(string movieName,bool persist){}
public int getDuration();
}
I got these info from the API documentation of the lib.
Now is th
-
- Help with class
by OrlandoG
- 4 Replies
- Last post
by IsshouFuuraibou
- Hello! I'm trying to create a class with properties but I'm not sure how to go about it. I want to do something like "gps.Latitude.DecimalValue" where it will give me the decimal value or "gps.Latitude" where it gives me the coordinate in regular form. I know how to do the GPS stuff. Where I need help is figuring out how to get the value in one class over to another. Can someon
-
- On pressing F10 or F11 debugging is ending
by Santosh BSK
- 3 Replies
- Last post
by TaylorMichaelL
- Hi,
I am using VS 2005 with SP1 , C# In my solution , i put a break point and it is getting hit. But, when i press F10 or F11 unable to continue further, just ending the debug with error : The program '[5892] AdminLoader.exe: Managed' has exited with code -532459699 (0xe0434f4d). I tried looking at all settings and dignostic attributes but everything is fine. Any Ideas kumar
-
- Help with Membership.GetUser
by smileymtb
- 2 Replies
- Last post
by smileymtb
- I need some help with an application that I am trying to develop in C#. How do I go about obtaining the email address from the current user logged on. I need this so that I can use it in the "sTo" portion of an automated email that will be sent on the click of a button.
Do I use Membership.GetUser() Where do I go from there
Thanks for your help in advance.
-
- To Make My C# Project an exe
by manjunath cv
- 2 Replies
- Last post
by Figo Fei - MSFT
- Hi guys i have developed a c# project now i have to make it an Exe so that i can install it on any system and run it... the bin which contains the exe only runs in the system which has .net installed and does not executes where there is no .net.... as
this is my first project can any one tell me how to make my application
an exe file so tat it can be installed and executed on any system.. Regard
-
- Can not marshal parameter #3: The type definition of this type has no layout information.
by Alexei_shk
- 14 Replies
- Last post
by Alexei_shk
- Hi,
I got the error: Can not marshal parameter #3: The type definition of this type has no layout information.
My code in C# is:
Code Snippet
[DllImport("CadIO.dll", EntryPoint = "dxfDrawViewToList")]
unsafe static extern bool dxfDrawViewToList(IntPtr dc, ArrayList lstData, ArrayList lstIndexes, int x, int y, double z);
Ho
-
- Are streamWriter functions performed synchronously ?
by Sabrecat
- 11 Replies
- Last post
by Peter Ritchie
- Ive got a piece of code in a windows service that I have written that has forcedme to resort to somthing that I really dont like. Here is the code in question.
while (again) { try { aFileName = tempadvcommfolder + loanNumber + "-" + loanName + ".Htm"; tw = new StreamWriter(aFileName); tw.Write(emailHTML); tw.Flush(); tw.Close();
-
- using System.Collections
by JaK82
- 2 Replies
- Last post
by JaK82
- Hi,
Posted another thread the other but no reply so I thought I would put the question a bit differently,
At the start of c# file you tell it that you are using certain classess, ie using System.Collections
If I wish to use a third party class like the google api
using Google.GData.Client;
Where abouts should I put the classess in order to reference them,
Many Thanks
-
- How to set timeout for file search?
by Missa580255
- 2 Replies
- Last post
by Missa
- How to set timeout for file search For example: i want to check if file X.txt exists on network adress \\computerA\d$\X.txt . I use "file exists" property of FileInfo class, but if computerA is turned off i need to wait about 15 seconds and then I receve the result. I want to set this timeout for example to 5 seconds, but I don`t know how. One solution is to ping computerA over the s
-
- Interfacing a mobile phone
by usamaalam
- 3 Replies
- Last post
by Michael Koster
- Hello everybody, Is there a way to connect a standard mobile phone with PC and and write code to send/receive SMS(plain text messages) to other mobile devices from PC using the mobile phone that is connected Thanks.
-
- Run application as a Service
by thukralz
- 12 Replies
- Last post
by Ross Dargan
- What type of project it should be to run as a service
Say if I create something and want to run it as a service how to do it and some of my other application has to use that service how does that work
-
- rename a directory
by Konstantinos Polychronis
- 6 Replies
- Last post
by Matthew Watson
- How can I rename a directory
-
- Is there any way for overloading increment/decrement operator for postfix and prefix operations uniquely?
by Paresh_Sen_3889e7
- 1 Replies
- Last post
by nielsvanvliet
- Is there any way to distinguish between a prefix or postfix form of ++ or in overloaded form
-
- Misbehavior of Find+Replace
by AaronLST
- 2 Replies
- Last post
by OmegaMan
- Using Quick Replace on a single text document open in visual studio with Find what as: \n+ Replace with just has a single space in it. Look in: Selection, Use: Regular expressions I would expect it to replace all new lines with spaces. In a selection that contains 20 lines, it only replaces 2 newlines. However, if I change it from Selection to Current Document, it has no problem at all replacing a