|
I believe this has come up on the DOTNET mailing list before. Try searching its archives.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
File f = new File();
Stream s = f.Open("\\\\.\\COM2");
maybe something like that can work
but i'm nt sure
|
|
|
|
|
I didn't find anything about compression(like zlib) in framework.
did i miss something? I wanna have my xml file zipped before sending out.
|
|
|
|
|
Hi,
I found this on George Shepherd's Windows Forms FAQ.
FAQ:
http://www.syncfusion.com/FAQ/Winforms/
Article link
45.2 How can I read and write zip files in my Windows Forms program.
Check out 'The Zip/GZip Implementation For .NET' available here. This library is released under a special GPL. Check out the above page for details.
|
|
|
|
|
There is a managed version of zlib available on the icsharpcode site.
J# will also provide libraries for porting Java 1.2 to .NET in that is the compression libraries that Java 1.2 had.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I meet such a situation that there is hundreds of classes in a big namespace, and i just want to borrow something from it.
i write something like this:
=====================================
namespace big
{
class apple;
class banana;
...
}
=====================================
namespace small
{
class apple: big.apple
{
}
}
=====================================
But i hope not to use inherit. is there any way to declare a alias or mapping?
|
|
|
|
|
If you mean, give a new name to an existing object; then yes you can do that.
using apple = big.apple;
This only works on a file by file basis though.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Thank you.
But what i exactly want is something like the cpp's #define.
#define small.apple big.apple
And pick the defines in a single header file, then it will only expose small part of a big library to user.
BTW, when i transfer my former cpp code to C#, i find it difficult to do with the #define macro.
for example
#define AT_LEAST(A,B) ...
here A B can be int, float, or double (surely template is another choice).
But in C#, #define can only define a symbol served for selected compile.
any suggestion?
|
|
|
|
|
nova chen wrote:
And pick the defines in a single header file, then it will only expose small part of a big library to user.
Nope, for that you'll have to create empty wrappers as you had mentioned in the first post.
nova chen wrote:
But in C#, #define can only define a symbol served for selected compile.
This is because #define's aren't type safe, and .NET is extremely type-safe; which is why they took out the ability to use macros in code. In most cases whenever you used a macro you should use a function instead.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I've been trying to find a way to interact with the Windows OS natively in C# (for both windows and web forms), particularly adding/deleting/monitoring/displaying tasks in the Task Scheduler.
Can anyone help me find some info on this?
Thanks ahead of time!!
|
|
|
|
|
I have a problem with properties when making a Windows control
when i place the control on a form,properties of type string does not appear in the properties box.
I used this syntex:
public string Txt
{
get{//some code;}
set{//some code;}
}
The Text property of the base class (UserControl) doesn't appear too.
Also when I include a description for a property, the description doesn't
appear:
[
Description("Describe the property")
]
I use the beta2 varsion of visual studio..
can any one help?
|
|
|
|
|
Where can I found tutorials about socket programming! ? ?! ? ?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
There are some in C# section in codeproject.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Hello
Has anyone experienced problem with the Socket class ??
That is when I'm sending async data then when I have sent more than 2200 bytes then the socket will never close correctly even if I do
m_sock.Shutdown(SocketShutdown.Both);
m_sock.Close();
That is the .NET will think it closed but the server on the other end will never see that it closed. (Yes the server is working correctly, and detects closing from C++ and old VB)
I have downloading working fine with the .NET socket. But always when uploading then the closing procedure wont work when total bytes sent are greater than 2200 bytes, and it does not seem to mater if I send it all at once or in parts.
So the question here is if anyone else has this problem, and if this is a known issue ?
|
|
|
|
|
Are you using a Beta or RC of (VS).NET?
There was a known bug in the Betas/RC where the Socket.Close function didn't close the socket. If you want the full details search the DOTNET archives.
With it being such a large bug I would assume that it has been fixed in the final versions.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
Hello James
Thanks for the answer
I get this both on Studio B2 and Studio Final SP1
|
|
|
|
|
I have framed Web form, I want to pass parameter (query string) from left frame to right, so in the right frame it will show the records according to whatever user selected from left frame. How can I accomplish this?
Beginner
|
|
|
|
|
do it in your link.
<a href="RightFrame.aspx?varA=1&varB=foo+that+hurts" target="rightframe">
I suggest at least skimming the HTML 4.1 Specification for a better understanding.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
I wanna declare class with multiple inheritance .
public class myclass: System.class1 and System.Class2
How should I write the code that compiler accept it?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
You can't, not directly anyway.
You are limited to one base class, but you can implement as many interfaces as you desire.
The recommended way is to have class1 and class2 be interfaces (or just one of them be an interface). The downside is that it makes it more difficult to extend existing functionality because you have to reimplement everything.
I suppose one solution would be to have interfaces IClass1 and IClass2 then create your classes Class1 which implements IClass1 and Class2 which implements IClass2 .
Then your class that "inherits" from Class1 and Class2 implements both interfaces, relegating the method calls back to Class1 and Class2 objects if the base functionality is desired. And since you implement both interfaces you can cast the object to both interfaces as well.
Its not pretty but it should work for the most part.
James
Sonork: Hasaki
"I left there in the morning
with their God tucked underneath my arm
their half-assed smiles and the book of rules.
So I asked this God a question
and by way of firm reply,
He said - I'm not the kind you have to wind up on Sundays."
"Wind Up" from Aqualung, Jethro Tull 1971
|
|
|
|
|
So you can not do something like this?
<br />
class myClass:Class1<br />
{<br />
<br />
}<br />
<br />
class Class1:Class2<br />
{<br />
<br />
}<br />
Nick Parker
|
|
|
|
|
Nick Parker wrote:
So you can not do something like this?
class myClass:Class1
{
}
class Class1:Class2
{
}
Of sourse you can - that's single inheritance.
But you can't do:
<br />
class myClass: Class1, Class2<br />
{<br />
}<br />
The "solution" is to do the following:
<br />
class Class1<br />
{<br />
void foo(){};<br />
}<br />
<br />
interface IClass2<br />
{<br />
void bar();<br />
}<br />
<br />
class Class2: IClass2<br />
{<br />
void bar(){};<br />
}<br />
<br />
class MyClass: Class1, IClass2<br />
{<br />
Class2 m_implClass2 = new Class2;<br />
<br />
void bar()<br />
{<br />
m_implClass2.bar();<br />
}<br />
}<br />
<br />
Hope this helps!
Dale Thompson
|
|
|
|
|
Thanks for clearing me up on this one Dale.
Nick Parker
|
|
|
|
|
Sure thing.
Dale Thompson
|
|
|
|
|
This you can do.
I'm not really sure what this is called (baring a mini-object model).
I understand multiple inheritance as:
<br />
class mybase1<br />
{<br />
}<br />
class mybase2<br />
{<br />
}<br />
class mysuper:mybase1,mybase2<br />
{<br />
}<br />
<br />
Which you can't do in C#.
Cheers,
Simon
X-5 452 rules.
|
|
|
|