|
I'm writing an app that will talk to a USB device. I wonder how can I check that i have lost my USB connection just like in windows.
Donkaiser
|
|
|
|
|
Hi,
I tried to send mail from c# windows application but i am unable to send the mail.i am getting the following error.
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Could not access 'CDO.Message' object.
The code i wrote is
System.Web.Mail.MailMessage mailMsg = new MailMessage();
mailMsg.From ="chand.p@icinfotech.com";
mailMsg.To = "chand.p@icinfotech.com";
mailMsg.Priority = MailPriority.High;
mailMsg.Subject = subject;
mailMsg.Body = body;
mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html;
MailAttachment sFile = new MailAttachment(attachment);
mailMsg.Attachments.Add(sFile);
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(mailMsg);
reply me if any one know the solution for this problem.
|
|
|
|
|
Unless your local machine is the mail server you will need to set SmtpServer to a valid address, maybe something like mail.mycompany.com or 234.10.44.20
|
|
|
|
|
hi thanks for replying me.
i have used my company mail server but i am receiving the same error.i tried this in vs2003 but in vs2005 it is working fine.
|
|
|
|
|
If you are using VS2005 you should use the System.Net.Mail namespace, System.Web.Mail has been deprecated.
|
|
|
|
|
Yes,i used System.Net.Mail namespace in vs2005.Do you have any alternate solution for my problem?if any,please kindly reply.
|
|
|
|
|
I don't realy see that you have a problem. It works with VS2005 but not with VS2003, so the obvious answer is to use what works. Is there a reason why it needs to work using .NET 1.1?
|
|
|
|
|
Hi,
I have my web services in c#
a VC client makes a call to this Web service -> Web Method
The signature of the Web method looks like
[Web Method]
public void retrieveData(string SampleString){}
Now Say the client sends "VC+" as the sample string to the above web method
In the web method, the samplestring is received as "VC " and not "VC+"
( The + char is getting replaced with space character )
how to solve this problem?
thanks in advance
chandru
|
|
|
|
|
Hi
I have an ArrayList of objects and I want to loop thru the ArrayList. For each object I want to give the user options of how to configure/change values in the object.
So basically what I would like to happen is that for each of the objects in the ArrayList the system must wait for the user to make changes and press a button to "Proceed". Once the button is clicked the loop must continue to the next object. I cannot use a MessageBox because I have quite a few RadioButtons that give the user options for configuring the objects.
Any suggestions of how to go about this? Perhaps using threading?
Thanks
Kobus
|
|
|
|
|
try maybe the following:
1) Add a Windows Form to your project where you add all the different options. The fast and dirty way says that you make all your textboxes, radiobuttons etc not private but internal or public. Lets call the formfor our purpose frmEditor
2) Now in the area where you want to loop over your array to the following:
for (int i = 0; i < myArrayList.Count; i++) {
mycustomobject co = (mycustomobject ) myArrayList[i] ;
frmEditor f = new frmEditor();
f.txtValue.Text = co.SomeValue;
f.chkCheckBox.Checked = co.SomeBoolean;
f.ShowModal();
co.SomeValue = f.txtValue.Text;
co.SomeBoolean = f.chkCheckBox.Checked;
}
I wrote this code without having VS in front of me, so just check the syntax.
-- modified at 8:54 Wednesday 21st June, 2006
|
|
|
|
|
gnjunge wrote: frmEditor f = new frmEditor();
For performance reasons I would place this line before beginning the for loop.
|
|
|
|
|
|
You could display your options dialog modally (ShowDialog) that way the loop will be blocked until the dialog is dismissed, then continue on. There are of course more elegant solutions, but this will get the job done.
|
|
|
|
|
Having a window pop open immediately after closing the previous one would probably be very annoying to most users. Think about it, how many apps have you used where it keeps opening the same window over and over again, just to display different values? Probably not many.
IMO, you should create the dialog and pass it the ArrayList. Have it traverse the list, displaying one object's values at a time. When the user has processed every item, then close the window. That approach would also make it easy to allow the user to navigate backwards in the list too (perhaps you'd have two navigation buttons, "Previous" and "Next"). That should give a much less jarring and obnoxious user experience.
Just a thought...
Josh
-- modified at 9:47 Wednesday 21st June, 2006
|
|
|
|
|
Hi,i can not change this statement in VB.NET to C#.Could everyone helpme?
Dim strCompanyName as String<br />
strCompanyName = CType(dgItem.FindControl("lblCompanyName"), Label).Text
with "dgItem" is DataGridItem and "lblCompanyName" is the id of a label (server control).I've tried this
Label lb=(Label)dgItem.FindControl("lblCompanyName");<br />
Response.Write(lb.Text);
but it did not work.Thanks for all replies.
|
|
|
|
|
The code you posted looks correct, do you get any specific error? What do you mean by "but it did not work."
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
I want to retrieve the text of that label but it does not print the text so i say it didnt work.The syntax is correct but the result is not.Thanks for your reply
|
|
|
|
|
You can also write:
Label lb= dgItem.FindControl("lblCompanyName") as Label;
Response.Write(lb.Text);
Maybe you have created a class with the name label and it tries to convert it to that class, so just to be sure add the whole namespace to the label.
|
|
|
|
|
Try:
Label lb = (System.Web.UI.WebControls.Label)dgItem.FindControl("lblCompanyName");
Response.Write(lb.Text);
HTH
|
|
|
|
|
thanks for ur reply.I've tried ur code but nothing happened however it does not generate any error.It did not print the text of the label.Is there others way?thanks for reading
|
|
|
|
|
Looks to me that it prints the code of the label but it's empty at this time... OR that this code is never actually executed. Try printing out a few non-space characters before and after the label text like:
Response.Write("*** "+lb.Text+" ***");
Now if you see some asterisks in the result then you know it's printing empty label. Then you have to figure out when this code is executed and what you actually have on this label. If you can't see any asterisks then obviously this code never gets executed...
HTH
|
|
|
|
|
From our Instant C# VB to C# converter:
string strCompanyName = null;
strCompanyName = ((Label)(dgItem.FindControl("lblCompanyName"))).Text;
Note that your original conversion was attempting to cast "dgItem" to a Label.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter
Instant C++: VB to C++ converter
Clear VB: Cleans up VB.NET code
|
|
|
|
|
Are you using masterpages ??
If you are then the controls id will not be "lblCompanyName"...it will be something like "ctl00_Main_lblCompanyName"...which is prefixed by the content placeholders id....so you should use the following code.
Label lb=(Label)dgItem.FindControl(this.lblCompanyName.ClientID);<br />
Response.Write(lb.Text);
This may help..possibly
Cheers,
Craig
** I'd rather try and fail than fail to try **
|
|
|
|
|
Native C# Protection (NCSP) is a protection tool (not obfuscator) for C# 2003 applications.
The goal of NCSP is to produce trial versions with limited functionality of C# applications.
With the correct NCSP Key these applications work as registered versions.
NCSP uses only NATIVE (but peculiar) TO C# means, i.e. NO EXTERNAL PROCESSING
of C#-produced executable.
NCSP protects NOT CODE, BUT DATA needed to run the application.
In case of C# applications DATA IS A CORRESPONDENCE BETWEEN EVENTS AND EVENT
HANDLERS.
The difference between trial and registered versions produced by NCSP is based
on use of DIFFERENT EVENT HANDLERS FOR TRIAL AND REGISTERED VERSIONS of the
protected application. The trial version uses one set of event handlers, while
the registered version uses another one.
NCSP protects forms of C# project on the source level, i.e. NCSP temporarily
MODIFIES THE SOURCE CODE, then, AFTER RE-COMPILING, THE APPLICATION IS
PROTECTED.
During the process of protection NCSP MODIFIES THE SOURCE CODE of the form in
such a manner that after re-compiling each protected event has no event handler
assigned. During the protected application start TRIAL EVENT HANDLERS ARE
ASSIGNED TO THE CORRESPONDING EVENTS. If valid NCSP Key is
provided then REGISTERED EVENT HANDLERS REPLACE THE TRIAL ONES.
The protected application DOES NOT USE a call of some CHECKING ROUTINE to
choose which set of event handlers to use. Instead it USES DATA containing in
NCSP Resource and in NCSP Key TO ASSIGN REGISTERED EVENT HANDLERS TO THE
CORRESPONDING EVENTS.
NCSP trial version may be downloaded from http://www.posolsoft.com/files/NCSP/NCSP.zip
More information about NCSP may be found at http://www.posolsoft.com/NCSP
Oleg Subachev
oleg@posolsoft.com
|
|
|
|
|
Keep your f*cking ads out of here!!
|
|
|
|