|
Sorry for the lack of my courtesy
Okay let me verify my question.
In SSL/TLS, there are a struct called Alert Message. Now what it does is to notify the server/client a few things according to what it is going on.
Now with the SSLStream in .NET 2, it doesnt seem to have an option of handling that alert (notification).
So now my question is .. do i need to implement it? because if there is something that I am missing and can handle that, then i dont have to do it
THANK YOU.
Elapid For The Win
|
|
|
|
|
Thanks for the clarification.
No, the SSL Alert protocol has not been implemented in the .NET Framework, ... yet anyway.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
you are the man!
Thanks
Elapid For The Win
|
|
|
|
|
Hello all,
I have to develop a project which can generate/capture a media streaming of different protocol(e.g. RTP,Microsoft multimedia server(MMS), ...).
So, is there any thing by which i can handle differet protocol?
Also mention that all stream are captured by media player/My own.So, I hava to handle different Encodeing/decoding(e.g. mp3,wav) techniques.
I mention that I see the functionaliy of VLC Player. But I have no idea to handle the component(axVLCPlugin) by C#.Net.
|
|
|
|
|
Hi!
I'm working on some math routines, and I need to see if two double's are *almost* equal. I've read
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
and tried to implement the same thing in C# with doubles. After a bit of fiddling I got this following code:
public static bool CheckedApproximatelyEqual(double a, double b, int maxSteps)
{
if (double.IsInfinity(a) || double.IsInfinity(b))
return false;
if (double.IsNaN(a) || double.IsNaN(b))
return false;
ulong aInt = unchecked((ulong)BitConverter.DoubleToInt64Bits(a));
if ((aInt & 0x8000000000000000) == 0x8000000000000000) aInt = 0x8000000000000000 - aInt;
ulong bInt = unchecked((ulong)BitConverter.DoubleToInt64Bits(b));
if ((bInt & 0x8000000000000000) == 0x8000000000000000) bInt = 0x8000000000000000 - bInt;
long dif = unchecked(Math.Abs((long)aInt - (long)bInt));
return dif <= maxSteps;
}
Now the question is how does this look? Do you have any methods you believe are better for comparing floats?
There's *AT LEAST* one problem with this implementation, and that is denormalized values. Any suggestions on how to handle them? I guess I can just round them off to either zero or the smallest normalized value depending on their value!?
|
|
|
|
|
Hi,
I need a way to search a file with regular expressions to find the following syntax:
somevariable = "daaata on maybe one line" +
"might even be continued on more lines" +
"and so on...";
So actually to get from 'somevariable ..' to the end of it at 'on...";'.
Now, I have been using regular expressions numerous times, but I cannot determine how to check this?
Thanks!
- -
Regards SirErugor
-- modified at 9:43 Thursday 19th January, 2006
|
|
|
|
|
How do i remove white spaces from the beginning of a rich text.
thanks
Nana
|
|
|
|
|
Use the Trim method...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks. But it is not working. I used the enter key to return to the next line. I did that through a couple of lines before typing the data. Now what I need to do is remove those return characters from the beginning while keeping the format.
thx
Nana
|
|
|
|
|
Well those are not spaces, so logically it will not work, eh?
Then you will have to use the Replace method, figuring out the algoritm shouldn't be to hard...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
Hi All,
This might stem back to 'C' days and I probably ought to change my 'mindset' and other such phrases but old habits die hard. Call me Cliché Man...
When I write an applicaton, I tend to have a source file or two put aside to put all 'those little useful functions' in. You know, generic things like formatting a postal code, validating things etc. that don't fit in with a specific class anywhere. Well, using C#, I've implementing this as follows:
In library.cs:
<br />
namespace mylib {<br />
public class rog {<br />
static public int DoSomething(int arg) {<br />
return arg+1;<br />
}<br />
}<br />
}<br />
To call this function, I'm putting this in app1.cs:
<br />
using mylib;<br />
...<br />
b = rog.DoSomething(3);<br />
This seems like using a class where there is really no need. I'd like to just call 'DoSomething(3)' without the 'rog.' part.
I'm new to C# so be gentle, I'm old to C and C++ so feel free to be harsh.
Am I being stupid?
Thanks for any confirmation or denial...
Rog
|
|
|
|
|
You can't have methods without a class in C#...
So considering that your aproach is ok, but maybe not so OOish
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You can't do that in C#
In latest java (1.5) you can do static import and in C# 2.0 you can have static class that will force you to have only static members and can't instentiate that class.
One possible (but not recommended) solution would be to have
class rog
{
... static methods here...
}
class myclass : rog
{
... now you can call methods of rog without rog.
}
|
|
|
|
|
That's sort of what I'm after - I didn't think of deriving my class from the library - seems a roundabout way of resolving the function names though.
What I'm after really is a way of defining functions in the same way as you would, for example, the 'sin()' function as I'd much rather use:
result = sin(pi*4);
then
result = rog.sin(pi*4);
The library doesn't have any actual data (or if it is, it'll be static) and I don't intend to instantiate an instance of it.
I still have this nagging feeling that I just haven't 'got the hang' of C# yet...!
Rog
|
|
|
|
|
Hi everybody!! Is it possible to bind a bidimensional array of double to a datagrid?if yes how can i do this?
I can't manage this.
Thank you so much
Alessio
|
|
|
|
|
You wrote:
8) now place the encryption/decryption key in the registry and lock it down with security so that only your application has the rights to read it.
what do you mean about registry, and "lock it down with security.."?
|
|
|
|
|
Please reply to the appropriate message rather than start a new thread. If "RealCondor" has elected to receive email notifications of a replies to his post then he'll get an email telling him that - there is even less of a guarantee that he'll see this message.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
iam building chat application.It connects will in LAN between networked PC(s) && also successful in connection on my own localhost on the same pc . But the Problem is That when i gave my friend the client application and ran my server. I gave him then my ip address . But it can't connect to my ip address whereas iam running my server application so well iam not firewalled also . Iam using dial up and he is using dial up also. I tested it with one of my friends using DSL but the problem is the same.
How can i make it connect to any user on the internet by knowing his ip address and port assume that they are not behind firewall or NAT's or anything ?
Human Knowledge Belongs To the world
|
|
|
|
|
First, make sure that your server isnt listening on "127.0.0.1". While this will work for your computer (localhost), no one else will be able to connect to it. Next, try getting an IPAddress from Dns.Resolve(Environment.MachineName).AddressList[0]. This will enable your server to listen on the correct address for any computer you place it on. Then you just have to give whoever else the IP Address of your server so they connect, and it SHOULD fix your problem. If it still doesnt, try checking your Windows Firewall.
C#Guy
|
|
|
|
|
So it works fine on your LAN. You client has a DHCP address and your server has a static IP correct?
Well your static IP is visible on your LAN but not on the WAN. Your dialup ISP probably can if not already assign you a static IP. The WAN IP is gloablly accessible (i.e. via the Internet). Inside your premise (house) you will also have to setup routing so that the PORT your chat server is running on can have public data routed to it. For example if you have a Linksys Router check out Advanced->Port Forwarding.
For testing, if you can dialup and then connect to the public IP / Port then you should be in good shape. However until you get to the point where you can connect, tell you friends to hold off.
Good luck
Mike Luster
|
|
|
|
|
So what do i have to do to make my friends connect to me !!! and i want to be able to connect to any ip address on the internet by knowing the ip address and the port number ???? like any remote administration tool like subseven or prorat or any others how could they do that ?
i need clients in voice session , the voice is directed to each one pc without the interfere of the server it will be so heavy for the server to handle text and voice at the same time
Mess With The Best And Die Like The Rest
|
|
|
|
|
This does appear to work, however is this really how you're supposed to do it:
I'm calling the WinSpool API method EnumPrinterDrivers:
[DllImport("winspool.drv", CharSet=CharSet.Ansi, SetLastError=true)]
public static extern bool EnumPrinterDrivers
(
[MarshalAs(UnmanagedType.LPWStr)] string pName,
[MarshalAs(UnmanagedType.LPWStr)] string pEnvironment,
uint Level,
IntPtr pBuff,
uint cbBuf,
out uint pcbNeeded,
out uint pcReturned
);
In C speak The pBuff would be a pointer to an array of DRIVER_INFO_1 structs. I have declared these as:
[StructLayout(LayoutKind.Sequential)]
public struct DRIVER_INFO_1
{
[MarshalAs(UnmanagedType.LPStr)] public string sName;
}
Heres my method, it's the pointer arithmatic that I'm curious about, seems to be very clumsy:
public static unsafe string[] ListPrinterDrivers()
{
string[] arrDrivers = new string[]{};
try
{
uint nNeeded = 0;
uint nCount = 0;
IntPtr ptrData = IntPtr.Zero;
//how much do I need
EnumPrinterDrivers(null, null, 1, ptrData, 0, out nNeeded, out nCount );
if ( nNeeded > 0 )
{
//alloc space for array
ptrData = Marshal.AllocHGlobal((int)nNeeded);
bool bOK = EnumPrinterDrivers(null, null, 1, ptrData, nNeeded, out nNeeded, out nCount );
if ( bOK && nCount > 0 )
{
arrDrivers = new string[nCount];
IntPtr ptrArrStructs = ptrData;
for ( int idx=0; idx< nCount; idx++ )
{
DRIVER_INFO_1 dinfo = (DRIVER_INFO_1)Marshal.PtrToStructure(ptrArrStructs, typeof(DRIVER_INFO_1));
System.Diagnostics.Debug.WriteLine("Got Printer driver: " + dinfo.sName );
arrDrivers[idx] = dinfo.sName;
//
//OK so now I increment the pointer. Is there a better way
//
int nSize= Marshal.SizeOf(dinfo);
byte* ptrStruct = (byte*)ptrArrStructs.ToPointer();
ptrStruct += nSize;
ptrArrStructs = new IntPtr((void*)ptrStruct);
}
}
Marshal.FreeHGlobal(ptrData);
}
}
catch ( Exception exp )
{
System.Diagnostics.Debug.WriteLine(exp.ToString());
}
return arrDrivers;
}
|
|
|
|
|
Hi there,
I have a form with a data grid. when i click on the header portion, an arrow is shown there wrt the order of sorting . I'm planning to do a multi column sorting. I'l be usinb a key (shift/Ctrl) to select the columns.
When i select more than one column using a particular key, the arrow should be there on all the selected columns headers.
Is there a way to show the arrow on multiple column headers???
Thanks
Els
|
|
|
|
|
Hi All,
I have an application which navigate a URL in AxWebBrowser. According to my application the URL will be navigated for more than 1000 times. I am clearing the cache after every navigation.
The problem is... when I start executing the application and open any other page and again trying to view the execution the window is not shown properly.
Can any body please help me in this case?
Thanks in Advance
Jaya
|
|
|
|