|
Hmmm, very interesting. I had no idea you could invoke methods using reflection that you otherwise would not have access to. I knew you could FIND the private methods of other classes in the way you presented, but I expected the environment to throw an exception if I tried to invoke them. Anyway, this is very interesting. Just as an aside, I feel obligated to tell you that there is an operator "typeof" that can get the type of a class without you needing to instantiate it. Therefore, you can convert "(new ClassA()).GetType()" to "typeof(ClassA)". This alleviates you from needing to instantiate, then throw away, some class.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
If ClassA and ClassB are in the same file, then ClassB has access to ClassA's internal members anyway, so there's nothing unusual going on here.
|
|
|
|
|
Someone on here has said you can, but I still don't believe it.
|
|
|
|
|
Hi,
I've implemented DragDrop functionality between two DataGridViews using the MouseDown event. The problem is both Grids have DataGridViewCheckBoxColumns and DataGridViewComboBoxColumns, which require that the user be able to click on the objects contained in those columns and change them as needed. The MouseDown event is preventing these objects from reacting to the user's MouseClick. I need a way to implement DragDrop between two grids without disrupting the DataGridView's ability to handle normal MouseClick events. I'm looking for a different event that could be used to handle the DragDrop. Any help is appreciated. Thanks!
|
|
|
|
|
Hi guys!
I was wondering. When I have a reference to a dll in my program and I change that dll, do I have to re-compile every app that uses that dll? I am trying to create re-usable code that I can call from many apps (5 +) and won't have to recompile all of them when I change code in a common location. I am trying not to use a webservice as the objects are quite large.
|
|
|
|
|
If you have given the DLL's reference, then you need to refresh that DLL in client projects your self.
Instead, if you give the reference of the Class Library Project itself, then this operation is handled for you.
Hope I am clear enough.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I have a small app that emails me a message every morning. I recently had to change the SMTP port from 25 to 587 on our server due to spam. So I went into the code and changed the SmtpMail.SmtpServer = 192.168.1.15 to 192.168.1.15:587. I am getting this error:
The server response was 421 Cannot connect to SMTP server 192.168.1.15 (192.168.1.15:25), connect error 10061.
It seems it is still trying to access on port 25. I looked around a bit, but could not find anything on how to change the port it uses. I thought adding the port to the end of the IP address would be sufficient.
Thanx in advance
Jude
|
|
|
|
|
Hi,
Surprised to know that you are still using .Net framework 1.0 / 1.1.
In v1.0 or v1.1 you need to set Fields property of MailMessage class's instance for changing default port like this --
objMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", NewServerPort)
NewServerPort will be your port; in your case 587.
Also objMessage is instance of MailMessage class.
I will recommend you to use .Net 2.0 framework for sending mails, because it exposes appropriate properties for everything related to mails.
There is a change in namespace and the new one is - System.Net.Mail.
Hope this helps !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thanx a lot!
I am not an all day coder. I write little apps and scripts to help me out through the daily grind. I do the tech support work for a small business and my main job is keeping everything running smoothly and handling all the computer problems when they arise.
I have .Net 2.0 installed, but how do I use it in VS2003?
Jude
|
|
|
|
|
Hi,
I am afraid, but you cannot use .Net Studio 2003 for developing applications on framework 2.0. For that you will need VS.NET 2005 or VS.NET 2008. I think 2008 is a better choice since it can be used to develop applications that target all framework versions.
Of course, the choice is yours (rather your company's)
Hope this helps.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thats what I thought. I installed VS2005 a while back, but it was buggy and a resource hog, so I uninstalled and stuck with 2003.
I got a beta disk of VS2008 from MS last month, but have yet to play with it.
What about with Monodevelop?
Jude
|
|
|
|
|
TheJudeDude wrote: resource hog
Just curious about your machine configuration
TheJudeDude wrote: What about with Monodevelop?
I have no idea about Monodevelop. I havent used it yet.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Abit VA-20, AMD Barton 2800+, 2GB Corsair DDR 400, 78 GB Raptor. Runs photoshop pretty good, and that is a horse.
Jude
|
|
|
|
|
Hi,
I'm not sure this problem belongs here, but this is probably just as good a place as any for it.
Anyway. I'm working on a solution (written in C#) which uses the SQL Express database. I'm working with it in the Server Explorer, but the problem is that each time I start debugging, I must first manually right-click the connection to the database in the Server Explorer and select "Close Connection". Otherwise I get an error when I try to connect to it using my app (which is a web application, not sure if that matters). Which becomes quite annoying after some time. Is there a way to automatically close the connection when I start debugging? Or do you use some other method altogether?
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I have never had that problem, or heard of it. You might want to search google. Sounds like a strange bug to me.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Yup, strange indeed.
Google didn't give me anything useful, but then again I'm not the best at selecting search terms.
Are you using SQL Express?
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Yes I am using SQL Express, and vs 2005. Are you using VS 2003? what is the error message you are recieving?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I'm using VS2005 as well. I get the error when I try to open the database in code, and the actual error message is just a simple:
"Cannot open database "<name of="" database="">" requested by the login. The login failed. Login failed for user '<username>'. .Net SqlClient Data Provider"
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi,
I am working on a project that use the report generation , can anybody tell me what is the use of "CRAXDRT.REPORT" and what assembly i need to add for this DLL...
T@SU
|
|
|
|
|
tasumisra wrote: I am working on a project that use the report generation , can anybody tell me what is the use of "CRAXDRT.REPORT" and what assembly i need to add for this DLL...
CRAXDRT is Crystal Reports ActiveX designer runtime library. You can find that info on google, or in the documentation.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Is there any way to "follow" a JunctionReparse point using pure C#/.Net 2.0?
I've googled the subject but have been unable to find anything but examples that import some DLL. Importing DLL's to call Windows API's feels like a ugly hack, and I would rather make it work using the tools provided by the .NET Framework (if there is anything in the framework that provides the methods that are required to follow a directory/file which have the FileAttribute.ReparsePoint set)
//Geron
modified on Tuesday, January 22, 2008 7:28:18 AM
|
|
|
|
|
I hate to say this, but you're going to have to resort to using P/Invoke here.
|
|
|
|
|
how wonderfull. Why provide means to detect ReparsePoints but no means to do something like:
<br />
DirectoryInfo rootInfo = new DirectoryInfo("C:\myReparsePoint");<br />
foreach(DirectoryInfo subInfo in rootInfo.GetDirectories())<br />
{<br />
...<br />
}<br />
(the example above will end up with a security exception)
And even better, no means to actually make any sense to the actual target of a ParsePoint when you "find" one....
Ah, well. You dont happen to have a clean example of how to P/Invoke something to find the target of a ReparsePoint?
|
|
|
|
|
I have made some progress with this problem. I'm currently able to retrieve the reparse point target when using a combination of CreateFile and DeviceIoControl (P/Invoke). However the code only works on Windows 2000/2003/XP. When I run the same code under Windows Vista, I dont get a valid file handle when opening the reparse point with CreateFile. I'm suspecting that the security model in Vista is to blame (I'm tryng to find the target of "My Documents\My Videos", which I dont even have access to with my own user in my own documents folder).
|
|
|
|
|
Hi
Im having a .CSV file which is not having header,It has only the records to import to database.
I can able to read the csv file using ODBC, But the resultant Datatable takes the first record as the Header. Always its neglecting the first row.It starts reading from the second row.
How to solve this issue.
Help me out
Thanks in Advance
|
|
|
|