Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Grid Commander
Jan 7, 2007

thank you mr. morrison
Just to be clear, this is just an access layer for smtp.

Here is a bit of overkill information. Feel free to ignore it unless you are a bit more interested in mail on an Exchange box.

I used to work for Exchange, and can say that it is easier to use smtp in most cases... even if there is an alternative available in Exchange. (Special aspects of Exchange are slightly more difficult to use because they are mostly available through COM and active directory.)

Just for a bit more background: If you are using an older version of exchange, then it is built upon the smtp stack included with windows xp. New versions of Exchange have their own smtp stack. Basically though, it is still smtp at its core. Anything that can be done as far as sending and recieving mail is concerned can be done using industry standard techniques (smtp, imap, pop) on an exchange server.

Exchange also offers some other extensions and features to smtp.
These mostly relate to
better performance (more messages per second),
better storage features (mailbox quotas and backups),
better user access options (stopping a recursive reply all from unprivilaged users),
spam blocking,
and much more security.

Adbot
ADBOT LOVES YOU

Grid Commander
Jan 7, 2007

thank you mr. morrison
You need to remove it from the gac and then reboot your machine.

There is an internal tool at the place that I used to work at that accomplishes the removal from the dllcache without requiring a reboot. (It was a special version of the delete command) But, even that did not work all of the time. It only worked sporadically -- which of course sucks.

Rebooting your machine should cause the cache to flush and the deleted assembly to actually go away.

Sorry about this. I had to deal with it a lot at my old job, and there is really no good way around it (that I am aware of) outside of the hive.

Can you do a lot of the work without using gac, and then add the gac cache feature towards the end of development?

On another note, a good tip is to not sign your assemblies until close to the end of the development cycle too.

Grid Commander
Jan 7, 2007

thank you mr. morrison

DLCinferno posted:

....Is there a way to get the mime type from the file extension without using the registry? ....

I'd like to know this as well. Currently I'm pulling from the registry and I cache the type (and icon index) in a hashtable so it helps minimize the hit, but if there is some way of using Win32 or something I'm all ears.

Yes, figure out what each file formats' header is. Most binary files have special header at the top of the file. It will be different for different file types. It will be stored at a different location for each file type. It will likely be stored in the first 12 bytes of the file.

The registry is easier, but can sometimes "lie" since you are just checkng for file associations instead of actually using the semantics of the file itself to check its type.

For a good example look up most unix file types, or look at the bitmap or jpeg file formats.

Have fun.

Grid Commander
Jan 7, 2007

thank you mr. morrison

ljw1004 posted:

There's already a windows function which does this -- looks at the data to determine its type:
FindMimeFromData

Nice!! And elegantly named, guess it shows what an extra 10 seconds of research might have turned up if i had just typed that stuff into Google.
Thanks for pointing that out.

Grid Commander
Jan 7, 2007

thank you mr. morrison
I have a little chunk of code that launches a cmd process.
I want all of the input and output redirected from a network stream.
I remember being able to do this redirection one time before, but it was a few years ago and I've forgotten how I did it.

Any ideas?

static void Main(string[] args)
{
TcpListener client = new TcpListener(23);
client.Start();
Socket sock = client.AcceptSocket();
NetworkStream myNetworkStream = new NetworkStream(sock);
StreamReader myStreamReader = new StreamReader(myNetworkStream);

Process p = new Process();
ProcessStartInfo si = new ProcessStartInfo();
si.FileName = @"C:\WINDOWS\system32\cmd.exe";
si.Arguments = "/k";
si.RedirectStandardError = true;
si.RedirectStandardOutput = true;
si.RedirectStandardInput = true;
si.UseShellExecute = false;
p.StartInfo = si;

//begin -- this doesn't work because these are read only
p.StandardInput = myNetworkStream;
p.StandardOutput = myNetworkStream;
p.StandardError = myNetworkStream;
//end -- this doesn't work because these are read only

p.Start();
p.WaitForExit();
}

Grid Commander
Jan 7, 2007

thank you mr. morrison
I looked for a while to try and find some *good* open source e-commerce app in .net or .net 2.0 but I had no luck with this.

I didn't really want to spend time writing my own, so....

Eventually, I broke down and just installed apache, mysql, php, and oscommerce on my windows box. Basically this is a lamp stack except it is on windows. So far it works wonderfully, plus I get the added benefit of an OS that doesn't need as much memory (clean XP Home install -- fully patched), and an OS that I am more familiar with.

Note that if you go this route, then I would suggest purchasing a good book on apache/mysql/php like "Beginning PHP and MySql 5" that will help you get the stuff installed.

On a side note -- I think it might be possible to host php on IIS? There might even be a php variant that targets MSIL. I didn't research that much though, so I can't say for sure.

Be prepared to spend a day or two figuring out how to get the install just right. I like Linux, but Linux application documentation seems to go out of date rather quickly ... and so it can be misleading.

Alternatively, just send me a message and I'll help you avoid the pain that I went through.

Anyway, good luck.

Grid Commander
Jan 7, 2007

thank you mr. morrison

SLOSifl posted:

Because people ignore warnings and the switch statement is weird enough that a fallthrough is a reasonable expectation.

The compiler error is more like missing a closing brace than anything else.

edit: I wish they just made switch use code blocks.
code:
switch ( comparisonVariable ) 
   case ( someValue ) {
     // do stuff
   } or ( somethingElse ) {
     // do stuff
   } or ( whatever, whateverElse ) {
     // multiple values
   } else {
     // let's not pretend it's not just an if-else if-else statement
   }
I don't know, something like that. My version there looks terrible, but come on, code lables?

Switch is basically a special case that does not fit your need in this scenario.
Switch can not be used for your example at all.
Edit: Meaning a new programming construct would be required to make code as you have suggested above work.
It looks like you basically need a bunch of if statements here.

Here is what you describe above (except rewritten):

code:
bool handled = false;
if (someValue)
{

  handled = true;
}
else
{
  if (somethingElse)
  {

      handled = true;
  }
  else
  {
    if (whatever && whateverElse)
    {

       handled = true;
    }
    else
    {
    }
  }  
}

if (handled == false)
{
  //your switch else here
}

Adbot
ADBOT LOVES YOU

Grid Commander
Jan 7, 2007

thank you mr. morrison
Make sure that there are some collumns in the listview.
Make sure that the view is set to details.

Here is some code to add an item that has a subitem.

ListViewItem i = new ListViewItem();
i.Text = "List Item";

ListViewItem.ListViewSubItem si = new ListViewItem.ListViewSubItem();
si.Text = "List Sub Item";
i.SubItems.Add(si);
listView1.Items.Add(i);

Edit: here is some code to change the text of the subitem

this.listView1.Items[0].SubItems[1].Text = "hey";

Grid Commander fucked around with this message at 00:00 on Mar 3, 2007

  • Locked thread