|
Look at the available overloads. I was doing it right according to intellisense.
"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
|
|
|
|
|
No, there is no overload that takes just a char, they all take char arrays. Which, IMO, sucks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There is no overload that matches the second example. There is only one which has the params modifier which you use in the first example, all other overloads just have char[].
params can only be used for the last parameter in a method, they could have provided a string.Split(int count,params char[] separator) but they haven't.
|
|
|
|
|
Hi,
I'm trying to impersonate user identity between two WCF services (tcp.net).
When the client and the two services located on the same machine, everything work fine.
But when I move the services to a different machine than the client, it fails to pass the impersonated user identity to the second service (Client -> Server1 -> server2). I’m getting the following exception: “Either a required impersonation level was not provided, or the provided impersonation level is invalid”
Is it possible to do such a thing? what should be the configuration of the two servers?
|
|
|
|
|
Hi,
I would like to create a custom attribute for my C# application which will decorate methods. So far no problems. But I noticed that the attirbute constructor being called only when I reflecting the attribute parameters. I would like that the attribute's constructor will be called every time I enter the method (like when decorate a class with an attribute and its contructor being called when creating an instance of the class). How can I do this?
|
|
|
|
|
This isn't possible without getting into other concepts like PostSharp[^]
Attributes are intended to be evaluated at run time through reflection.
|
|
|
|
|
I'm looking for something similar to PrincipalPermission attribute.
So when I enter the method I'll be able to do a certain check (permissions check) and throw an exception if needed.
How does it implemented in PrincipalPermission?
|
|
|
|
|
You will need to do this yourself when you enter the method. You need to use reflection to see if the method has the attribute and take the appropriate steps if it does or doesn't.
The functionality you describe isn't implemented in the attribute at all. It is implemented by the calling method. Keep in mind that some of this behavior is intrinsic to the .NET runtime itself and checking security permissions like this should be part of the runtime function calling behavior.
|
|
|
|
|
I'm trying to set with filetype there are aloud to be when your are uploading.
I gett this errormessanger: CS1525: Invalid expression term '.'
The line thats error:
Line 10: string StrFileType = File1.PostedFile.ContentType(.JPG | .PNG)
The hole code:
void UploadFile(object Sender,EventArgs E)
{
if (File1.PostedFile !=null)
{
/
string StrFileName = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") + 1) ;
string StrFileType = File1.PostedFile.ContentType(.JPG | .PNG) ;
int fileSize = (int)Math.Round((double)File1.PostedFile.ContentLength / 1024, 0);
int maxSize = 1024;
if (fileSize > maxSize)
Response.Write(" Uppladningen misslyckades! Storlek får högst vara 1mb ");
else
{
File1.PostedFile.SaveAs(Server.MapPath("img\\" + StrFileName));
lblUploadedFileName.Text ="Länken till bilden: http://domain.com/se/img/"+StrFileName;
lblbbcode.Text ="BBCode: [img]http://domain.com/se/img/"+StrFileName + "[/img]";
}
}
}
Frozzare, Segeltorps Scoutkår
www.segeltorps.scoutkar.nu
|
|
|
|
|
You might want to try putting quotes around the items in the ContentType. At the moment, the code looks as though it's a constant.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Then i get this errormesseanger:
CS0118: 'System.Web.HttpPostedFile.ContentType' is a 'property' but is used like a 'method'
Frozzare, Segeltorps Scoutkår
www.segeltorps.scoutkar.nu
|
|
|
|
|
It's bad karma getting you for posting a programming question in the lounge.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
hi
String fileExt =
System.IO.Path.GetExtension(this.File1.FileName).ToLower();
ramana
|
|
|
|
|
I have a simple text box and a button when i click on a button the data must be saved to a table in sql how it can bedone
sas
|
|
|
|
|
|
SqlCommand myCommand = new SqlCommand("INSERT INTO Designation (Designation) " + "Values ('string')", myConnection);
the problem is in this line how to insert a text box value in the values place
sas
|
|
|
|
|
sajid.salim.khan wrote: SqlCommand myCommand = new SqlCommand("INSERT INTO Designation (Designation) " + "Values ('string')", myConnection);
the problem is in this line how to insert a text box value in the values place
What about myTextBox.Text? That'll give you the contents of the textbox.
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
i have done that but how to placeit in the value of mycommand parameter
SqlCommand myCommand = new SqlCommand("INSERT INTO Designation (Designation) " + "Values HERE ('string')", myConnection);
sas
|
|
|
|
|
programmer can learn only by googling around in MSDN or somethng like this. Dont, expect direct answer in CodeProject.Try somethings by yourself...
Regards
Chintan
www.visharadsoft.com
(I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
|
|
|
|
|
Anyone know how to do it? I need to figure out a way to run all of the unit tests under a specific namespace using C#.Net 2.0
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
How to find a particular cell value in GridView RowUpdating event.
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e).
Please suggest.
Thanks
|
|
|
|
|
|
Hi,
I have a label and a tooltip associated with it.
If i hold the mouse over it and after a while the tooltip disappears.
string data = "hello world";
tip = new ToolTip();
tip.AutoPopDelay = 1500000;
tip.InitialDelay = 50;
tip.SetToolTip(this, data);
When i hold the mouse over the label again nothing is shown.
Is there a property or something to make it appear everytime i hold the mouse over
or shall i create the tooltip one more time?
Thanks!
|
|
|
|
|
I think u have not understand all its property. Try updating AutoPopDelay prty.This wil giv u the solution...
Regards
Chintan
www.visharadsoft.com
(I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
|
|
|
|
|
I've done some googling, but haven't turned up any answers to my questions - can anyone help?
1) My application reads comma delimited records from a file. The read and split is very fast indeed, but after they've been read I need to create objects out of the records, do some validation etc. etc. This can take a while to complete for large record sets. Aha, says I, multiple threads can speed this up.
My plan is to have one thread read the file and then place the returned string array in to a queue. Then as many worker threads as needed can dequeue an individual array in the queue and go off to do its work.
First up - is this a sensible approach, or is it a real stinker of an idea and are there better ways to achieve the same?
2) Is dequeuing thread safe, or could two threads attempt to dequeue the same item in the queue?
3) Are there any guidlines on the number of threads one should spawn for a given processor type? My PC has a Quad Core in it, which I assume means that things really can happen concurrently. My users, however, may well be limited to single core processors which I think will mean that the threads will share processor time - could too many threads in this situation lead to much slower performance as they all vie for time?
Thanks.
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|