|
|
ALT + F4 wrote: What is difference between c# and c#.net
<br />
string strone="C#";<br />
string strtwo = "C#.Net";<br />
Console.Write(strone.Length.ToString());<br />
Console.Write(strtwo.Length.ToString());
Ans:
2
6
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
.NET is the Microsoft implementation of the CLI, so C#.NET implies the Microsoft implementation of the C# language.
However, if you are using something other than the Microsoft implementation, you should specify it, so unless you specify any other implementation, C# and C#.NET means the same thing.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
I wrote a little Server and run it under Win 2003 and Win 2008,
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)]
[WebService(Namespace="http://www.pyramid.de", Description="Pyramid")]
public class WormRaid : System.Web.Services.WebService
{
[WebMethod(MessageName="WriteBytes")]
public long WriteBytes (byte[][] memData)
{
return (memData[0].Length + memData[1].Length);
}
}
Now my problem is that the second byte array in a byte[][] is always received as 0 bytes, when the first byte[] length is a odd multiple of 1024 (1024, 3072 or ...). This error occurs only without MTOM, with MTOM everything works fine (see attached code).
The error is probably in the server side because the same error can be produced with a GSoap Client (also without MTOM).
Here my Client Code:
internal static int Main (string[] args)
{
long fsize1;
long fsize2;
long byteswritten;
byte[][] ba;
WormRaid wr;
Random rand = new Random();
try
{
fsize1 = 1024L;//only odd multiple of 1024 will not work
fsize2 = 512L;
Console.WriteLine(" (" + fsize1 + "), (" + fsize2 + ")\n");
// Create the data to send
ba = new byte[2][];
ba[0] = new byte[(int)fsize1];
rand.NextBytes(ba[0]);
ba[1] = new byte[(int)fsize2];
rand.NextBytes(ba[1]);
//Create Stub
wr = new WormRaid();
wr.Url = "http://localhost/WSE3Test/WSE3Test.asmx";
//First Test will work always
Console.WriteLine("WSE3 MTOM:");
wr.RequireMtom = true;
byteswritten = wr.WriteBytes(ba);
if (byteswritten != fsize1 + fsize2)
{
Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));
}
else
{
Console.WriteLine("OK\n");
}
//This test will fail
Console.WriteLine("WSE3 without MTOM:");
wr.RequireMtom = false;
byteswritten = wr.WriteBytes(ba);
if (byteswritten != fsize1 + fsize2)
{
Console.WriteLine("!!! ERROR LENGTH !!!\nWritten: " + byteswritten + ", expected: " + (fsize1 + fsize2));
}
else
{
Console.WriteLine("OK\n");
}
}
catch (Exception exc)
{
}
}
Sample output:
-------------------------------------------------
Y:\>Client.exe
(1024), (512)
WSE3 MTOM:
OK
WSE3 without MTOM:
!!! ERROR LENGTH !!!
Written: 1024, expected: 1536
-------------------------------------------------
Get anyone the same results?
Is there any known solution for this Problem?
Thank you,
-- Daniel Wehrle
|
|
|
|
|
Ok, I had this simple image box and when setting the image property to my 1 pixel width image, I see a stupid fading effect applied to my image?? Why does the IDE have to nose in and "fix it" for me
Please help
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If you want a solid color, you have to use nearest neighbour scaling instead of bicubic scaling. If the control has no propery for changing this, you have to scale the image yourself before putting it in the control.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hey Guffa!
Thanks, but it's not working, I believe it has something to do with PixelFormat that I cant set
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: Thanks, but it's not working
What's not working?
Muammar© wrote: I believe it has something to do with PixelFormat that I cant set
How do you try to set it?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Create a new bitmap of the same size with the PixelFormat you want and copy the old image into this one.
|
|
|
|
|
Hello Mr. Solo
Sorry but DOH , can you tell me how to do it?? Did you try it??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi All
Who I Can Add Footer To DataGrid Or DataGridView In .Net By Using C# Code
In Windows Application ??
This Option May Be Tack To Cerate New Windows Application Control Inhert From DataGrid Or From DataGridView .
Who I Can Do That ?
Thancks For Any Body Help me
Thaer
|
|
|
|
|
Code(C# .Net 2.0):
private System.Windows.Forms.ToolStripButton toolStripButton_Scan =new System.Windows.Forms.ToolStripButton();
this.toolStripButton_Scan.ToolTipText = "New transaction created from scan";
question:
How to change the style of the text "New transaction created from scan".
Thank you!
|
|
|
|
|
The simple answer is: you can't.
If you really really have to, it might be possible by handling the tooltip yourself.
To do this you'll need to:
(1) Create a tooltip you can maintain reference to.
(2) Implement your own draw via the Draw event, drawing the desired string via the graphics object provided.
(3) Intercept the appropriate mouse events to popup and clear the tooltip.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Thank u.
Now,I can get the tooltip by the sentence like this:
ToolTip tip = (ToolTip)ToolStrip1.GetType().InvokeMember("ToolTip", BindingFlags.GetProperty | BindingFlags.NonPublic|BindingFlags.Instance, null, ToolStrip1, null);
I'm able to change the backcolor , forecolor etc.. Except the fontsize.
My purpose is to change the fontsize. how to do it ?
|
|
|
|
|
Add an event handler for the Draw event, then handle the drawing yourself.
The event args will have a Graphics instance you can use to draw the string.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
|
I want to create a backend application which posts data to a asp.net web server at regular intervals of time..
How to implement this??
Also, if I use a web service, will that me helpful??
Can anyone help me??
Som
|
|
|
|
|
do you understand what is meant,when they say "backend"?
Please tell us in details what do you ant to do and how far have you gone doing it,remember we cannot do work for you, start and get stuck and we will unstuck you.
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Is it possible to insert a array in the value part of a dictionary?
I want this array of bool:
bool[] arrayOfBool = new bool[10];
I'm not sure how to setup the dictionary, I tried with this:
Dictionary<int, Collection<bool[]>> dict1 = new Dictionary<int, Collection<bool[]>>();
Or this:
Dictionary<int, bool[]> dict2 = new Dictionary<int, bool[]>();
But when I try to add an item for each dictionary, I get some errors. Maybe the entire dictionaries are wrong.
Is this possible? If so, how?
/Steffe!
|
|
|
|
|
What error are you getting? Compile time? Run time? "Errors" isn't very helpful, you know.
Anyway, this works for me:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace CollectionDictionary
{
class Program
{
static void Main(string[] args)
{
bool[] array1 = new bool[10];
bool[] array2 = new bool[10];
FillBools(array1);
Thread.Sleep(1000);
FillBools(array2);
PrintBools(array1);
PrintBools(array2);
Dictionary<int, bool[]=""> dict = new Dictionary<int, bool[]="">();
dict[1] = array1;
dict[2] = array2;
PrintBools(dict[1]);
PrintBools(dict[2]);
}
private static void FillBools(bool[] array)
{
Random r = new Random((int)DateTime.Now.Ticks);
for (int i = 0; i < array.Length; i++)
{
array[i] = r.Next() % 2 == 0 ? true : false;
}
}
private static void PrintBools(bool[] array)
{
foreach(bool b in array)
{
Console.Write(b + ", ");
}
Console.WriteLine();
}
}
}</int,></int,>
|
|
|
|
|
Your dict2 attempt is the correct way. This is how you add an item to the dictionary:
dict2.Add(42, arrayOfBool);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks, that worked!
I tried to write the value "true", to one of the bools in the array, with this code:
dict2[42].arrayOfBool[1] = true;
But it didn't work. I got this error:
'System.Array' does not contain a definition for 'arrayOfBool'
How do I get access to one of the bools in the array, so I can give it value?
/Steffe!
|
|
|
|
|
dict[42] will return the array, so you should be able to access the n'th element of the array using
dict[42][n] = true;
|
|
|
|
|
Thanks! That worked fine
|
|
|
|
|
I have a question. I have an image and I want to binarize it in C#. I don't want it to be in a fax (black and white 1 bit) format. It can be in grayscale but it needs to be binirized.
Any ideas on this?
|
|
|
|