http://msdn.microsoft.com/msdnmag/issues/05/04/AdvancedBasics/default.aspx[^] This is written for VB.NET, but you should have no trouble using it in C#...the information in the article is what you want anyways. Good luck Have a wonderful evening Doug Wright Developer, TDCI
tdciDoug
Posts
-
How to get ConfigurationSettings for multiple users -
referencing a control on another formput a function in form2 to get your value, and then call it from form1. Set your label there. Have a wonderful evening Doug Wright Developer, TDCI
-
How to show a child form when parent form is busy?Use a thread to display the child form Have a wonderful evening Doug Wright Developer, TDCI
-
Why doesnt this workGood post, I tested this out after posting to him earlier and saw that my suggestion wouldn't help. I was curious as to why it wouldn't hide as well. Have a wonderful evening Doug Wright Developer, TDCI
-
Why doesnt this workYou need to make changes to your form in your onload or constructor...not in the Main. Have a wonderful evening Doug Wright Developer, TDCI
-
IIS Server VariablesDoesn't REMOTE_ADDR give you the IP of the user? I want the IP of the actual server that is hosting the website. Have a wonderful evening Doug Wright Developer, TDCI
-
IIS Server VariablesSERVER_NAME "Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs" I have used this, and all I ever get is the host name. How do I return the IP address of the host using this option?? Have a wonderful evening Doug Wright Developer, TDCI
-
removing hyphens from a valueDim yourString as String = "567-343" yourString = Replace( yourString, "-", "" ) Have a wonderful evening Doug Wright Developer, TDCI
-
Strange Errors, BehaviorAn application, written using Visual Studios 2002 .NET, everything works perfectly. Recently, I migrated all of the code into Visual Studios 2003 .NET (built a new project and imported files.) This is a windows C# application, by the way. On the live machines, the application is experiencing very strange behavior. For instance: - Custom buttons not placing correctly - Handlers being fired more than once - Concurrency violation errors - Objects being disposed at the wrong time On my development machine, I'm seeing some of the issues, but not all of them. I am not getting the concurrency violation or mis-fired handlers on my development machine, but I am seeing the buttons not placed correctly and objects sometimes disposed of at the wrong time. I tried running the application on a separate development machine, and it also gave me the same behavior as my first development machine. None of these issues occurred when the application was compiled and run using visual studios 2002 .NET. I have checked and double-checked the environments between the live and development machines, and the .NET Framework is the same version (1.1.4322) and the .exe files are identical. There are no additional dependencies other than an Access DB file. Thanks for the help!! DougW48 dwright@tdci.com
-
Form switching methodYou could have also used User Controls. They would have been easier to work with since they would have each been their own class.
-
A C# SQL questionLook a few posts down at Heath's response about an SQL statement. While it is very humorous, he is also VERY correct. You have the same issue.
-
A C# SQL questionstring buffer_surname = textBox1.Text; mySqlCommand.CommandText = "SELECT name, surname FROM people WHERE name = 'James' AND surname = '" + buffer_surname.ToString() + "'"; You also should probably do a replace and replace any apostrophes with double apostrophes in buffer_surname, just in case. Hope this helps.
-
array issueThere are many ways you can go about doing this. There are a few questions you should look at first though. Is the array sorted? Can you define another data structure? Are you trying to keep the complexity below a certain level? I might do something like the following:
for (int iSize = 0; iSize < yourArray.Count; iSize++) { while (yourArray[iSize] != iSize) { if (yourArray[iSize] == yourArray[yourArray[iSize]]) { MessageBox.Show( "Duplicate value of " + yourArray[iSize].ToString() ); iSize = yourArray.Count; break; } Swap(yourArray[iSize], yourArray[yourArray[iSize]]); } }
I didn't really test this, just pulled it off the top of my head real quick. It might work, but I can't give any guarantees. Good luck -
embedding office functionality into applicationHow might one go about embedding certain Office features into a C# application? More specifically, I would like to be able to visually paste, resize, and crop images into a control in my application. Are there components I can simply include into my application to accomplish this? If so, can I also put them into an .ASPX page? Thanks!
-
Word-like com objectDoes anybody know of an object I can include into an ASP page that will allow me to PASTE a screenshot into it, and then CROP and RESIZE the image from within the browser? Thanks
-
Uploading multiple files on IIS server??It might be worth your while to look into programmatically zipping the directory, uploading the one file, and then unzipping it.
-
problem with c# (help required)Try changing your code to the following and seeing if it helps any:
[DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int _controlfp(int n, int mask); [STAThread] static void Main() { _controlfp(_CW_DEFAULT, 0xfffff); Application.Run(new Form1()); }
-
default valueI'm pretty sure you can define default values using table styles.
-
File/Directory Exists?Drive is the name of my virtual directory, which maps to what you call x:
-
File/Directory Exists?This is really an ASP question, but since I'm using C#, I'll post it here. I'm having trouble accessing remote files (or directories) out of my application. I simply want to check if a file exists on the other machine, which is shared on the same network. No dice, always comes up false. I have set up the IUSR_ComputerName and IWAM_ComputerName accounts on the remote computer to match my IIS account. Still returns only false. I've mapped a drive to the network location, and then put that mapped drive into a virtual directory. In the IIS Administrator I can see the files I'm trying to reach through this virtual directory...but the application only returns false. Here's the code from my application:
private void Page_Load(object sender, System.EventArgs e) { if (System.IO.Directory.Exists("Drive")) Response.Write(Server.MapPath("Drive") + " Exists "); else Response.Write(Server.MapPath("Drive") + " does not exist "); }
Thanks for the help on this. If anybody knows another method of accomplishing this same task, I'm all ears. All I can report is that we don't want to run IIS on the remote machine, and we don't particularly want to spawn an application to take care of the file maintenance...we'd like for the code to handle it. :)