|
i want to know about enumrator
omar el halwagy
|
|
|
|
|
1. Spell it correctly: IEnumerator
2. Type this into the top left textbox on CP.
3. Hit enter.
4. Look at the search result list[^].
5. Determine that this article[^] is probably rather good as a starting point.
Robert
|
|
|
|
|
If Robert's response wasn't what you were looking for...
1. Drop the "I" and try the contruct: Enumerator
2. Type this into the top left textbox on CP.
3. Hit enter.
4. Look at the search result.
If neither response helps, try asking a conherent question next time.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
i'm using sockets, i want to disconnect this socket after connection. but i can't disconnect it. it throws "An invalid argument was supplied"
i write "sck.Shutdown(SocketShutdown.Both)", but it can't work
what must i do plz help!!!
|
|
|
|
|
If you receive a SocketException when calling Socket.Shutdown(), use SocketException.ErrorCode to obtain the specific error code. Once you have this code, refer to WinSock 2 error code documentation[^]for a detailed description of the error.
Best,
Jun
|
|
|
|
|
Hi,
-Is it posible to recieve information about the stacktrace/execution history at runtime??
thx.
|
|
|
|
|
I believe that the easiest way is to just throw an exception and catch it.
string trace = null;<br />
try { throw new Exception(); } catch (Exception ex) { trace = ex.StackTrace; }
---
b { font-weight: normal; }
|
|
|
|
|
|
StackTrace st = new StackTrace();
|
|
|
|
|
Totally off subject, I got a copy of xacc.ide the other day, and it exceptions on load. No meaningful information, just ungracefully croaks.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
I have been trying to access frames with webBrowser document.
I always get the system telling me I don't have access. I read up on the net and it is a known issue due to security.
Has anyone ever achieved this?
HTMLDocument doc = (HTMLDocument) i_webBrowser.Document;
object aRef = frameNumber;
object anObj = doc.frames.item(ref aRef);
HTMLWindow2 aWindow = (HTMLWindow2) anObj;
HTMLDocument aDoc;
// the line below will cause the security exception
aDoc = (HTMLDocument) aWindow.document;
test
|
|
|
|
|
Hi All!
i am trying to use the ContextMenu control, and i do know how handle a click on it, i mean if you go the Form you can only handle popup event.
i tried to add to one menu item a click hasndler but it does not go in to the function that i created, can some one tell me how can i tell if the MenuItem in the ContextMenu was clicked and how can i handle it.
Thanks
|
|
|
|
|
ytubis wrote: i tried to add to one menu item a click hasndler but it does not go in to the function that i created,
Proper steps are:
1) Click on one menu item
2) Go to the event tab on the property panel
3) Double click on the click event; an event and handler shall be added
4) Find the handler function and fill in the function body with your logic
Best,
Jun
|
|
|
|
|
That is exectlly the problem, i see there only the popup event and not click event or select event and i do not know why??????
|
|
|
|
|
That sounds weired. I use Linux stations at work and only can check it out for you tonight. Hopefully you've found the answer by then.
Best,
Jun
|
|
|
|
|
In VS2003, when you select a menu item and click on the event tab, you should see the following events:
Click
DrawItem
MeasureItem
Popup
Select
Best,
Jun
|
|
|
|
|
Pls can any help me figure out if there is any error in this web sevcice client. I have included Username and Password for testing. When
http://dedicated134.eapps.com/pencomweb2/PENCOM_WebService.asmx is registered
classes exposed are:
PencomServer2.PENCOM_WebService c1 = new PencomServer2.PENCOM_WebService();
PencomServer2.RSANO_Response c2 = new PencomServer2.RSANO_Response();
PencomServer2.EmployeeRecord[] record=new PencomServer2.EmployeeRecord[2];
but of tesing purposes
(string r = c1.TestPenComService();)
can be used.
Sample code is:
required namespace are:
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Design;// formerly Microsoft.Web.Services3.Policy
using System.Security.Permissions;
using Microsoft.Web.Services3.Security;
using Microsoft.Web.Services3.Security.Tokens;
public void ReadData()
{
//Secure Service
//http://dedicated134.eapps.com/pencomweb2/PENCOM_WebService.asmx
// Create an instance of the Web service proxy
PencomServer2.PENCOM_WebService c1 = new PencomServer2.PENCOM_WebService();
PencomServer2.RSANO_Response c2 = new PencomServer2.RSANO_Response();
PencomServer2.EmployeeRecord[] record=new PencomServer2.EmployeeRecord[2];
// This is the username security token which is used by the service proxy
UsernameToken token = null;
Username = "PENSUREPFA";
Password = "NS946343PE";
byte[] passwordBytes = System.Text.Encoding.UTF8.GetBytes(Password);
string passwordEquivalent = Convert.ToBase64String(passwordBytes);
token = new UsernameToken(Username, passwordEquivalent, PasswordOption.SendHashed);
//PolicyEnforcementSecurityTokenCache.GlobalCache.Add(token); //wse3.0
//Get the SoapContext for the SOAP request that is being made to the Web service.
Microsoft.Web.Services3.SoapContext requestContext = c1.RequestSoapContext;
//Add the UsernameToken to the WS-Security SOAP header.
requestContext.Security.Tokens.Add(token);
//Encrypt the UsernameToken in the WS-Security SOAP header.
//X509SecurityToken serverToken = GetSecurityToken();
//requestContext.Security.Elements.Add(new EncryptedData(serverToken, "#" + token.Id));
//Create a new instance of the MessageSignature class by using
//the UsernameToken just added to the WS-Security SOAP header.
MessageSignature sig = new MessageSignature(token);
//Add the digital signature to the WS-Security SOAP header.
requestContext.Security.Elements.Add(sig);
//Specify the time-to-live (TTL) for the
//SOAP message to diminish the chance of someone
//intercepting the message and replaying it.
requestContext.Security.Timestamp.TtlInSeconds = 120;
//Call the Web service.
//c1.UploadEmployeesRecordToGetRSANos(record, 0023);
try
{
string r = c1.TestPenComService(); //test version
}
catch (Exception g)
{
MessageBox.Show(g.Message);
}
}
On trying to connect to a test method, the respose I get back is:
Microsoft.Web.Services2.Security.SecurityFault: The security token could not be authenticated or authorized ---> System.Exception: WSE563:
The computed password digest doesn't match that of the incoming username token.
at Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.VerifyHashedPassword(UsernameToken token, String authenticatedPassword)
at Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.VerifyPassword(UsernameToken token, String authenticatedPassword)
at Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.VerifyToken(SecurityToken securityToken)
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.LoadXmlSecurityToken(XmlElement element)
--- End of inner exception stack trace ---
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.LoadXmlSecurityToken(XmlElement element)
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.GetTokenFromXml(XmlElement element)
at Microsoft.Web.Services2.Security.Security.LoadToken(XmlElement element, SecurityConfiguration configuration, Int32& tokenCount)
at Microsoft.Web.Services2.Security.Security.LoadXml(XmlElement element)
at Microsoft.Web.Services2.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
Magic has often been thought of us the art of making dreams come true; the art of realizing visions. Yet before we can bring birth to the vision we have to see it.
|
|
|
|
|
I have two DataGridViews side by side with the same number of rows and columns. They connect to untyped DataSets. When I select a specific sell in the left DataGridView, I want the same cell to be selected in the right DataGridView. How do I go about doing that?
Thanks!
|
|
|
|
|
Hi,
I have doubt by using Shadowcopying. Please anyone give samples and explanation how shadow copy is working in .net windows forms using c#.
Thanks,
kokila.
|
|
|
|
|
|
Hi i was just wondoring if anyone knows how to create a trafic program with the 3 lights and cars going from left to right, right to left, up down and down up in c#
i did it in java it is easy but how can we do it in c#
thx
/\|-||\/|/\|)
|
|
|
|
|
It also the same. You can take your java source code and a little bit changes then you can compile it using C#. The language is almost the same.
|
|
|
|
|
stancrm wrote: It also the same
I know it is very similar but the thing is there are functions in java that i used that are not present in c# also i am not an expert in c# so for example i don't know how to represent the car as a moving object on the screen...
thx
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote: for example i don't know how to represent the car as a moving object on the screen...
How did you represent a moving car on the screen in Java?
Best,
Jun
|
|
|
|
|
Jun Du wrote: How did you represent a moving car on the screen in Java?
With frames do i have frames in c#?
thx
/\|-||\/|/\|)
|
|
|
|