|
Thats because it creates the SSL connection to the server... Did you look at SSLStream and try simulate it? I guess not. Do you know how SSL works? The mail program knows nothing about SSL encryption/decryption. Again I will refer you to SSLStream .
Spiro Floropoulos wrote: I think even Winshark is able to handle some SSL decryptions.
Unless you are Chuck Norris, your thinking does not mean anything. Either it works or it does not.
|
|
|
|
|
Spiro Floropoulos wrote: I think even Winshark is able to handle some SSL decryptions.
That's WireShark btw...
|
|
|
|
|
Yes, sorry Wireshark.
I see, so instead of worrying about decrypting SSL packets (I understand why being able to decrypt SSL so easily would totally defeat the purpose of having SSL) I should instead focus on perhaps creating a proxy or relay server to grab POP3 e-mails.
|
|
|
|
|
Spiro Floropoulos wrote: I see, so instead of worrying about decrypting SSL packets (I understand why being able to decrypt SSL so easily would totally defeat the purpose of having SSL) I should instead focus on perhaps creating a proxy or relay server to grab POP3 e-mails.
That's an excellent idea
|
|
|
|
|
You may want to look at an open source project called POPFile. I think it is on SourceForge.
|
|
|
|
|
Hello,
in my application, i create a lot of classes, which i only use "for the moment", what happens with the class, when i don't need them anymore? is it ok to delete the class with "myClass = null" or what must i do, to delete the class from my memory, because i think its a big amount of classes in my application, which i use only for one task and don't use it anymore.
i'm looking forward to hear from you
thanks
|
|
|
|
|
You don't need to do anything.
C# is a garbage collected language, which means when you have finished using an object, it will automatically be marked for garbage collection and removed from memory on the next pass.
You don't need to set it to null or anything, it will automatically be recognised as not in use once it passes out of scope.
(If you allocate _unmanaged_ resources in your class, like file handles, or database connections, then you should implement the dispose[^] pattern in the class to ensure they get cleaned up promptly)
Simon
|
|
|
|
|
Technically, you're working on "objects", not "classes". Terminology is important.
I believe that when the object goes out of scope, the garbage collector will eventually pick it up and free the memory.
Many of the .Net framework objects have a Dispose() method, so when you're done, you can call that. If you want to dispose your own objects, you have to derive from IDisposable , and override a few methods.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
What you mean is that you create instances of the classes, i.e. object with that class as type.
Unless you are using unmanaged resources in your objects, you don't have to do anything at all. When the object isn't used any more, it will eventually get removed by the garbage collector.
You can set the reference to null if it's a variable that you are keeping, i.e. a member variable in an object that you will keep using (for example a member variable in a Form).
If it's a local variable that will go out of scope, you don't need to remove the reference. Setting the variable to null in that case will not affect the memory management at all.
Creating objects that is used for a very short time is very common in .NET. Take for example a statement like this (items and pages are integers):
string x = "There were " + items + " items in " + pages + " pages.";
This will create five short lived objects (two boxed integers, one object array and two strings containing the string representations of the integers) which will be up for garbage collection once the string is created.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi there! as you guys can see, the topic says my problem. This is what I did: I finish my application, and I published to localhost folder to test the updates function. After that I went back to the solution, I builded, it went OK, and after that it gives me the error what you can see from the topic of this issue? Anyone can help me with this problem? It's very urgent!!! Thx ahead
|
|
|
|
|
Hi,
Can anyone please tell me how to convert following script into C# code.
strComputer = "atl-ws-01"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
For Each objUser In objGroup.Members
If objUser.Name <> "Administrator" AND objUser.Name <> "Domain Admins" Then
objGroup.Remove(objUser.AdsPath)
End If
Next
Thanks,
Mushq
|
|
|
|
|
string strComputer = "atl-ws-01";
objGroup = GetObject(@"WinNT://" + strComputer + @"/Administrators");
foreach( objUser In objGroup.Members)
{
if( (objUser.Name != "Administrator") && (objUser.Name != "Domain Admins"))
objGroup.Remove(objUser.AdsPath);
}
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Ahsan, thank you very much for the reply, can you please tell me what should be the data type of variable objGroup and how to use objGroup in foreach loop.
Thanks a lot,
Mushq
Regards,
Mushq
|
|
|
|
|
Good Day,
What is the best way to transfer files from C# to a Mobile phone? I need to transfer a small XML file.
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
There are two ways of doing this, and I've done both in applications before.
The easiest way is to use ActiveSync (XP and earlier) or Windows Mobile Device Centre (WMDC) for copy the file you with a folder that is synced with the device. The benefit of this method is you simply write to a regular file on the desktop system, and it doesn't matter if the mobile device is connected or not. Worst case, the file is synced across next time the device connects.
The second way, which involves a little more work is to use RAPI.DLL (you still need ActiveSync or WMDC) installed to do this. The API in RAPI.DLL allows you to connect to a device through C# and copy information to and from the device. Your best bet here would be to look at the RAPI docs on MSDN, or look at a framework from OpenNETCF Consulting which from memory, is free.
------------------------
Luke Lovegrove
------------------------
|
|
|
|
|
Thanks for the reply, Luke.
Sorry for not making things clear enough.
What I would like to accomplish is not a PC <-> Mobile transfer, but a Server-Client architecture.
SERVER <--> [WIRELESS ROUTER] <--> MOBILE CLIENTS
So the Clients (MOBILE) will request for the XML file from the server, the server in turn will respond by sending the XML file from the requesting client.
Please advice. I'm thinking of using web service for this and thought that others here may have a better solution.
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
modified on Thursday, August 7, 2008 9:11 AM
|
|
|
|
|
Yeah, I'd probably suggest a web service of sorts for that. Keeping it as simple as possible is always the best thing to do, especially with mobile devices.
You could hit the server directly rather than through a web service if you were so inclined as well. I haven't used the Syetem.Net namespace much on desktops or mobile devices, but I suspect it would be a bit easier code wise to request it through a web service.
------------------------
Luke Lovegrove
------------------------
|
|
|
|
|
Hi All,
Can you please give me the equivalent code in C# for the following?
unsigned char CardType[2];
stu = MF_Request(DeviceAddr, 0, CardType);
Message("Request Card", stu);
String str;
char code[100];
if (stu == 0)
{
str = " ==> CardType(Hex): ";
sprintf(code,"%02X%02X",CardType[0],CardType[1]);
str += code;
}
Thanks in Advance
shahtech
|
|
|
|
|
What's the problem? If you have an equivalent for the MF_Request function (which I have no idea what it is), the translation is trivial.
|
|
|
|
|
Thanks for quick response,
Its not a predefined function, just I want to know the equivalent syntax thats it.
Thanks
|
|
|
|
|
byte[] CardType = new byte[2];
stu = MF_Request(DeviceAddr, 0, CardType);
Message("Request Card", stu);
string str = null;
if (stu == 0) {
str = string.Format(" ==> CardType(Hex): {0:x2}{1:x2}", CardType[0], CardType[1]);
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
(via C++ to C# Converter):
byte[] CardType = new byte[2];
stu = MF_Request(DeviceAddr, 0, CardType);
Message("Request Card", stu);
string str;
string code = new string(new char[100]);
if (stu == 0)
{
str = " ==> CardType(Hex): ";
code = string.Format("{0:X2}{1:X2}", CardType[0], CardType[1]);
str += code;
}
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
I got a lib file from http://69.10.233.10/KB/IP/pop3client.aspx[^], and i was hoping someone could hep me with a problem im having.
I normally use thunderbird, so all the tests i do, i compare with the results from thunderbird. When i try to retrieve a plain text mail with the code i downloaded (above), it works great. The problem occurs when i try to download a compressed file (GZip compression algorythm).
This works fine with thunderbird, but the code i downloaded seems to hack up the file. When i compared the results with a hex editor (EditpadPro), the difference in files is enormous, your src seems to change the chars around (eg first 7 hex from thunderbird: 02 00 00 00 FF FF 73, first 7 from your src: 41 67 41 41 41 50 2F), also when i download the file with thunderbird is's 98 bytes, and when i use code i downloaded, the file size is 138 bytes.
This tells me that the file is still ok on the SMTP server, it's just when it gets downloaded. So im assuming its a encoding problem (not 100% sure).
Iv tried this with .Net 2.0, and Mono 1.9.1.
Thanks in advance.
George.
|
|
|
|
|
GeorgeBerry wrote: The problem occurs when i try to download a compressed file (GZip compression algorythm).
So, did you decompress the file after you downloaded it?
|
|
|
|
|
When i try to decompress the files, it doesnt work, i get an exception coz the file isnt in its origional state.
|
|
|
|