|
jwnin posted:You should take a look at reflector http://www.aisto.com/roeder/dotnet/. He does what you seem to want to do, so while it doesn't solve your problem it should be doable by an independent party. Thank you!! After some browsing on the msdn, I found this article (http://msdn.microsoft.com/msdnmag/issues/06/03/TestRun/default.aspx) which provides a tool to analyze assembly dependencies and method dependencies. That was exactly what I needed (I'm working on making a tool to help my company analyze its source code). (http://msdn.microsoft.com/msdnmag/issues/06/03/TestRun/default.aspx?loc=&fig=true#fig7) The code to analyze method dependencies also happens to use an API provided by reflector
|
# ? Oct 5, 2007 13:45 |
|
|
# ? Jun 10, 2024 13:58 |
|
Atimo posted:.... a bunch of crap .... I found a solution finally! After you add the webservice you need to go back into the generated proxy and add the refrence to the common interface the generics will be using. After that a little bit of reflection takes care of the rest! code:
|
# ? Oct 5, 2007 17:48 |
|
I have a class that I'm binding to a combobox on the compact framework.code:
|
# ? Oct 9, 2007 14:50 |
|
When you use the FileUploader is there anyway you can use network paths? I am creating a small application that transfers files to certain users desktops on request. A user who logs in as AS wants a certain file but the path to his desktop that works in explorer doesn't in ASP.NET. I have a previous application where "C:\Test\file" works but I can't get the path to go to one like this: \\10.0.0.1\c$\Documents and Settings\AS\Desktop\ Is this even possible?
|
# ? Oct 10, 2007 12:17 |
|
You probably need to create an app pool with a certain identity (ex: domain\websvc), assign the web site to that app pool, and grant that account permissions to the share on the desktop. Don't use c$ because that requires the website to have administrative privileges to the desktops.
|
# ? Oct 10, 2007 12:24 |
|
^^^Not really, that is a client-side issue, not a server-side issue methinks. Are the users running vista?
|
# ? Oct 10, 2007 12:27 |
|
No, the workstations are XP.
|
# ? Oct 10, 2007 12:37 |
|
Ryuichi posted:I have a class that I'm binding to a combobox on the compact framework. I believe that's the default behaviour. If you change the text in the dataSource, then you need to recall DataBind()
|
# ? Oct 11, 2007 14:57 |
|
I have a small asp.net webform that is feeding into a sqlserver 2005 database. Besides using a parameterized query and putting my connectionstring in the web.config file are there any other security measures I should be taking?
|
# ? Oct 11, 2007 16:24 |
|
Only other big one is to make sure your database user is running with the least possible permissions rather than DBO or sysadmin priviliges.
|
# ? Oct 11, 2007 18:09 |
|
wwb posted:Only other big one is to make sure your database user is running with the least possible permissions rather than DBO or sysadmin priviliges. Then I'm good to go. Thanks
|
# ? Oct 11, 2007 18:11 |
|
Why is it that the default "root" directory of my projects is always C:\Windows\System32 instead of, you know, the root of the project? Is there some kind of setting thing that I'm loving up or is there a way to get around that, or is it inherant in .NET or something?
|
# ? Oct 11, 2007 19:20 |
|
Myrddin Emrys posted:Why is it that the default "root" directory of my projects is always C:\Windows\System32 instead of, you know, the root of the project? Thats where the framework is based, so all the classes from the framework will be running from there. Try using current directory, I think thats the one that worked for me. I don't really have an issue, but just wondering how some of the other .Net gurus would go about this. I am trying to write a wrapper class for an xml that I will be posting to a webservice. How it will really work is that I will take in all this information from a webform, load it into said class, and the post that data into xml form to the webservice. I generated a class based off of an xsd and it works, but I am wondering if someone can suggest a more elegant solution. Fastbreak fucked around with this message at 21:47 on Oct 11, 2007 |
# ? Oct 11, 2007 21:40 |
|
Fastbreak posted:Thats where the framework is based, so all the classes from the framework will be running from there. Try using current directory, I think thats the one that worked for me. Add a web reference to the web service so you don't have to do the XML stuff yourself? You can use the strongly generated proxy and call the service as if it were a method. Or are you asking something else?
|
# ? Oct 11, 2007 21:53 |
|
Has anyone ever worked with sending emails from a .NET program? I'm using System.Net.Mail and an smtp client configured in my web.config with my account info on the mailserver I use. Messages will get sent so long as the recipient has a mailbox on my mailserver, but I'll get a relay error if they need to go anywhere else. What do I need to do?
|
# ? Oct 13, 2007 00:57 |
|
Nurbs posted:Messages will get sent so long as the recipient has a mailbox on my mailserver, but I'll get a relay error if they need to go anywhere else. What do I need to do? You need to configure your mail server to allow relaying (be very careful, being too liberal in relay settings and your mail server will be taken over by spammers).
|
# ? Oct 13, 2007 01:07 |
|
biznatchio posted:You need to configure your mail server to allow relaying (be very careful, being too liberal in relay settings and your mail server will be taken over by spammers). I kind of guessed that, but I guess my question is why its not sent as if I send it from outlook - I'm just curious to know how the mailserver makes the distinction. (Let's also pretend the server is out of my jurisdiction and my request for having the proper relay settings won't get approved, what are my alternatives?) Nurbs fucked around with this message at 04:09 on Oct 13, 2007 |
# ? Oct 13, 2007 04:03 |
|
Nurbs posted:I kind of guessed that, but I guess my question is why its not sent as if I send it from outlook - I'm just curious to know how the mailserver makes the distinction. I'm assuming you're talking about exchange server. I'm pretty sure(though I can be wrong) that outlook talks to exchange server through a protocol other than smtp, so you're using a different method than outlook does. I'm not sure if there are any APIs to talk to directly to exchange server's protocol earlier than exchange server 2007. It looks like 2007 has an API based on web services that might work, specifically the SendItem Method
|
# ? Oct 13, 2007 14:15 |
|
Nurbs posted:I kind of guessed that, but I guess my question is why its not sent as if I send it from outlook - I'm just curious to know how the mailserver makes the distinction. Outlook (the UI that you see) is just a MAPI client. It connects to several MAPI servers -- e.g. the MAPI PST server, which is a DLL that sits on your computer and lets MAPI clients interact with PST personal message stores. Also the MAPI Exchange server, which is a DLL that sits on your computer and lets MAPI clients interact with Exchange servers over the internet. Also the MAPI imap/smtp server, which is a DLL that sits on your computer and lets MAPI clients interact with IMAP/SMTP servers over the internet. Users won't have MAPI on their computer unless they installed Outlook. I bet that when you fire up Outlook, it's talking to a mailserver on a remote machine, not to the one on your local machine. If you wanted to send mails the same way that Outlook does, you could program interact with MAPI directly (that's hard) or with CDO (which is a fair bit cleaner but I don't know how it works with .net). The whole point of System.Net.Mail, as I understand it, was to give email functionality to .net programs even on computers that don't have Outlook installed on them. That's why it doesn't use MAPI at all. Instead it communicates directly with an SMTP server.
|
# ? Oct 14, 2007 04:02 |
|
ljw1004 posted:words Awesome, thanks!
|
# ? Oct 14, 2007 04:07 |
|
I need to convert between System::Strings and UTF-8 encoded std::strings. The following appears to work but I'm not sure if it's correct and if it's the most efficient way. Any comments?code:
|
# ? Oct 15, 2007 21:30 |
|
fankey posted:I need to convert between System::Strings and UTF-8 encoded std::strings. The following appears to work but I'm not sure if it's correct and if it's the most efficient way. Any comments? I don't think you can rely on s.length() to calculate the number of bytes to allocate and copy, since one character could be encoded by multiple bytes in UTF-8. That's what Encoding::GetByteCount() is for.
|
# ? Oct 15, 2007 21:37 |
|
fankey posted:I need to convert between System::Strings and UTF-8 encoded std::strings. The following appears to work but I'm not sure if it's correct and if it's the most efficient way. I wonder if there's a neater way to do it using pin_ptr instead of marshalling?
|
# ? Oct 15, 2007 21:43 |
|
csammis posted:I don't think you can rely on s.length() to calculate the number of bytes to allocate and copy, since one character could be encoded by multiple bytes in UTF-8. That's what Encoding::GetByteCount() is for. ljw1004 posted:I wonder if there's a neater way to do it using pin_ptr instead of marshalling? Update : This appears to work. Not sure if there's a way to use this for the unmanaged->managed call. code:
fankey fucked around with this message at 22:21 on Oct 15, 2007 |
# ? Oct 15, 2007 22:12 |
|
fankey posted:It was my understanding that Encoding::GetByteCount returns the number of bytes required to represent a .Net string in that particular encoding. In this case I'm going the other way - my string is raw UTF8 ( which should be guaranteed not to have any embedded nulls ) so string.length() should return the number of bytes in the UTF8 stream. No, it returns the number of non-null characters, which on Windows could be w_char and thus 16-bit (two bytes). char and byte aren't necessarily interchangable. ref: quote:Be aware that UTF-8 uses more than one byte for extended characters, so std::string::length() might not reflect the actual length of the string if it contains any non-ASCII characters. edit: In fact, the code on that page basically solves your problem, doesn't it? csammis fucked around with this message at 22:27 on Oct 15, 2007 |
# ? Oct 15, 2007 22:24 |
|
csammis posted:No, it returns the number of non-null characters, which on Windows could be w_char and thus 16-bit (two bytes). char and byte aren't necessarily interchangable. code:
This code, taken from the page you posted, is doing the same thing I am ( arguably a little safer - they're not assuming that std::string::value_type is 1 byte ). And it looks like you can use pin_ptr to go unmanaged->managed anyways. code:
FYI, if you are using that code, it crashes if you send it a 0 length std::string code:
fankey fucked around with this message at 23:16 on Oct 15, 2007 |
# ? Oct 15, 2007 22:38 |
|
Fun (pain) with IStream and COM interop. I have a COM library that I wrote, let's call it ComLib, with a method that takes an IStream as one of the arguments. I want to call this method from C#, passing in a C# class I wrote that implements InteropServices.ComTypes.IStream. The COM method signature in C# looks like this: code:
I tried implementing ComLib.IStream instead of InteropServices.ComTypes.IStream, and that time I got a "Class not registered" runtime error when I called the method. Update: the "Class not registered" error was caused by unrelated code, and I can in fact get this to work by implementing ComLib.IStream, I'd just rather implement InteropServices.IStream, for reasons below. What's going on here? I have another method that returns an IPictureDisp, and .Net recognizes it as an stdole.IPictureDisp just fine. Why does .Net think that IStream is defined inside my own library, while it correctly identifies IPictureDisp as belonging to stdole? I'd much rather implement InteropServices.IStream than ComLib.IStream. The InteropServices IStream has method signatures like this: code:
code:
Update: implementing ComLib.IStream works, as does using an unsafe block to read and write from the "out byte pv" argument as an array. I'm still confused about why .Net doesn't recognize IStream correctly. Mackin fucked around with this message at 20:57 on Oct 16, 2007 |
# ? Oct 16, 2007 20:38 |
|
I have a TaskBar application which has several Items in its main menu. One of those items requires activation, so when I click on it, my app prompts the user for a password. Upon a successful login, I build a ContextMenuStrip which gets populated with items, and set to that original item's DropDown property. Well, I actually redraw the main menu upon opening (in order to maintain some order) The problem is that my app doesn't appear to recognize the new Sub-Menu I created, at least until you hover over that original item, then all of a sudden it recognizes the menu, and displays the characteristic ">" next to the name. Clearly something is 'updating' on the MouseEnter event handler. I wouldn't normally care, but when that happens, the new menu won't actually open until the mouse comes off of the item, and then back on again, which is extremely annoying. However, it only happens the first time...after that it remains correct. I've tried refreshing and/or invalidating just about everything before opening, to no avail. Is there anything I'm missing that will help alleviate my problem? I am thinking this is a "lazy load" type issue, but I'm not sure. Thanks!
|
# ? Oct 19, 2007 14:19 |
|
Dude Koz posted:I have a TaskBar application which has several Items in its main menu. One of those items requires activation, so when I click on it, my app prompts the user for a password. Upon a successful login, I build a ContextMenuStrip which gets populated with items, and set to that original item's DropDown property. Try adding the menu items directly to the parent menu's DropDown property; not to a ContextMenuStrip that is then assigned to it. DropDown is a collection that's intended to hold the sub items.
|
# ? Oct 19, 2007 14:39 |
|
biznatchio posted:Try adding the menu items directly to the parent menu's DropDown property; not to a ContextMenuStrip that is then assigned to it. DropDown is a collection that's intended to hold the sub items. Normally I would do exactly as you said, but the Sub Menu is controlled by a Plugin, so I cannot add directly to the drop down. The plugin is an interface with a context menu property. Every plugin gets an item in the main menu (controlled by the framework) and then that item gets a dropdown set equal to the ContextMenuStrip of the IPlugin. Thanks.
|
# ? Oct 19, 2007 15:26 |
|
Sorry for the newbish question, and it might have been answered already, but I don't have time to read through 37 pages of posts. I did try Google and Wikipedia first though. I'm trying to do a fresh install of Windows XP Pro SP2 on my Thinkpad. I'm using nLite to remove components. I will probably mark the .NET Framework for removal as I will inevitably have to install the most recent version post install anyways (I think). Maybe this is a bad idea. Maybe a good one. I don't know. Anyway, I'm trying to figure out what I need to download for .NET Support. I was looking at RyanVMs page and he has a couple of switchless installers posted. The one I was looking at says that it contains .NET 1.1, .NET 3.0, and VC8 SP1 Redistributable (I don't even know what that last one is). I probably won't use the switchless installer though and just install it myself after I finish installing XP. What do I need to have an up to date .NET framework for Windows XP SP2 (with all the most recent hotfixes already installed)? Edit: I found out that VC is Visual C++. Do I need that as well? How is that related to the .NET Framework? Edit Edit: Here's the websites I'm thinking are the most up to date for both. Is this all I need? VC8 SP1 Redistributable: http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&DisplayLang=en .NET Framework 3.0 http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5-25634C3BF043&displaylang=en MrPhred fucked around with this message at 00:59 on Oct 20, 2007 |
# ? Oct 20, 2007 00:41 |
|
Hey guys...this is probably a freaking retarded question, but here goes. At my office, we have been using NHibernate for so long that going back to ADO.Net is like a foreign thing to me now. Have things progressed in that area much? Or is everyone just pretty much using something new now? Do most people still use ADO.Net? Do most people use strongly typed data sets? Are most people using O/R mapping tools? Please pardon the retardation of this post, I just feel extremely outdated.
|
# ? Oct 20, 2007 03:44 |
|
Hybridfusion posted:Hey guys...this is probably a freaking retarded question, but here goes. No, those are all very simple but good questions -- where I work, we code enterprise level cash and workforce management solutions, all using homemade objects for their flexibility. It takes longer, but in the end, it beats getting so married to an O/R solution that a problem with it causes just the kind of headache you were looking to avoid. We aren't a fan of typed datasets, and I absolutely hate the MS solutions for managing datasets.
|
# ? Oct 21, 2007 03:48 |
|
Does anyone know of a way to get/set the state of numlock, capslock, and scrolllock without importing user32.dll? If I do import user32.dll for whichever functions I need (also any tips here?), am I guaranteed that my code will work with any reasonable version of Windows(2k+)? I ask because I am developing on XP 64 bit, and I would hate to have this not work in other places.
|
# ? Oct 21, 2007 17:33 |
|
Hybridfusion posted:A non-retarded question. We use a variety of solutions depending on nature of the application. The large, industrial strength stuff flies off a home-brewed quasi ORM solution, largely for the same reasons lightbulbsun states. Biggest kicker is that most of the new, neato, augo-generated ORM solutions pretty much demand a 1-to-1 mapping of db to public properties, which might not make sense in some scenarios. For lighter-weight stuff which is not quite so long-standing, we have started to use SubSonic. It is a very, very nifty solution. We are actually contemplating ripping out the ADO.NET bits of the home-brewed stuff and using SubSonic to manage the mechanical angles of persistence. MS' new hawtness is LINQ. Which looks real neat, but I don't think it is quite ready for significant applications. See Rick Strahl's blog for some interesting 'features' he has found. More promising is the upcoming Entity Framework, which looks to be a very slick nHibernate killer. I cannot claim to have ever used a Typed Dataset outside of a classroom scenario. We use DataSets internally in our homebrew framework--sometimes it is alot more efficent to load multiple tables in one hit. But they definitely don't ever get passed outside of the data tier.
|
# ? Oct 21, 2007 17:55 |
|
Casimirus posted:Does anyone know of a way to get/set the state of numlock, capslock, and scrolllock without importing user32.dll? Getting, you can use this class from the Microsoft.VisualBasic library. Yes, it will work if you're using C#, but it won't work if you want to set the state. As for the rest of your question, Get/SetKeyboardState are supported from Windows 95 and Windows NT 3.1 and up. This can be found in the MSDN documentation for the functions under Function Information.
|
# ? Oct 21, 2007 18:11 |
|
So it sounds like everyone just kinda does their own thing. SubSonic looks freaking awesome and I may start to play around with that tonight. Good to hear that plain old ADO.Net is still popular, I am glad I am not light years behind like I thought I was.
|
# ? Oct 21, 2007 18:21 |
|
can one of you C# gurus tell me why this code isn't working? this code is from my global.asax file, and it's supposed to hook up the event to the timer when the application starts, then set the interval to a value stored in web.config, then execute the event once. Edit: the problem is the timer. ActiveUplidCount is supposed to be updating on an interval set by that value stored in web.config, but when I set that value to something really short, it doesn't update Let me know if you guys need more information about the situation code:
uh zip zoom fucked around with this message at 20:09 on Oct 21, 2007 |
# ? Oct 21, 2007 20:03 |
|
uh zip zoom posted:Edit: the problem is the timer. ActiveUplidCount is supposed to be updating on an interval set by that value stored in web.config, but when I set that value to something really short, it doesn't update How really short?
|
# ? Oct 21, 2007 21:06 |
|
|
# ? Jun 10, 2024 13:58 |
|
wwb posted:We use a variety of solutions depending on nature of the application. The large, industrial strength stuff flies off a home-brewed quasi ORM solution, largely for the same reasons lightbulbsun states. Biggest kicker is that most of the new, neato, augo-generated ORM solutions pretty much demand a 1-to-1 mapping of db to public properties, which might not make sense in some scenarios. I used datasets when I started out with .NET because it seemed like the obvious solution. Lately we've been using objects to pass data around with, and I like it a lot. I still use datasets in the latest project though, to be able to bind them to datagrids for very quick and dirty reporting. They're also easy to export to Excel for example. Using objects for that would be a lot slower to write. With datasets it's just basically writing a query, putting it in a dataset, and binding it to a grid.
|
# ? Oct 21, 2007 21:06 |