|
Hi,this is my code.how to use OR condition in c# code,this code is not working.i want to check the selected image extension.if the extension .jpg or .bmp then it is going to this condition code.what is wrong in that.
if (System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg" | System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp")
|
|
|
|
|
Try || ..
e.g.
if (System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg" || System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp")
|
|
|
|
|
Either || or | will work (although the non-short-circuiting single pipe is an odd choice here since it's more commonly used for bitwise or).
Are you sure you don't want to test for equality rather than inequality?
string lower = System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower();
if (lower == ".jpg" || lower == ".bmp")
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
I think u have to put 2 piping(||)characters in ur code
It's like this..
if ((System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".jpg") ||(System.IO.Path.GetExtension(cmdBrowse.FileName).ToLower() != ".bmp"))
try this once...
|
|
|
|
|
i made my web setup file
and worked well.
and now the database how can i Attach it -or restore it-what if the user doesnt have SQL i added sql express edition as prerequsities.
|
|
|
|
|
I have to mail a file as attachment which is on other server
How to access that file
Gaurav
|
|
|
|
|
try using the UNC path as such: \\Servername\foldername\filename.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
Hi,
I have an aspx app which needs to post data to a form and read the response.
i try to use "webClient" and "HttpWebRequest" classes, but can not get response ?
can you help me and get a refrence?
please
|
|
|
|
|
function xmlhttpPost(strURL) {<br />
var xmlHttpReq = false;<br />
var self = this;<br />
if (window.XMLHttpRequest) {<br />
self.xmlHttpReq = new XMLHttpRequest();<br />
}<br />
else if (window.ActiveXObject) {<br />
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");<br />
}<br />
self.xmlHttpReq.open('POST', strURL, true);<br />
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');<br />
self.xmlHttpReq.onreadystatechange = function() {<br />
if (self.xmlHttpReq.readyState == 4) {<br />
updatepage(self.xmlHttpReq.responseText);<br />
}<br />
}<br />
self.xmlHttpReq.send(getquerystring());<br />
}<br />
<br />
function getquerystring() {<br />
var form = document.forms['f1'];<br />
var word = form.word.value;<br />
qstr = 'w=' + escape(word);
return qstr;<br />
}
------------------------------------------------------
This is for posting....
self.xmlHttpReq.send(getquerystring());
This is for getting the response....
self.xmlHttpReq.responseText
|
|
|
|
|
hi : Michael Sync
tank you .
your answer is with javaScript.
can you get me an example with C# or VB.NET ?
|
|
|
|
|
Have you read Bassam Saoud's post?? maybe.. this is what you want..
|
|
|
|
|
you want to post data from an ASP.NET application to a form in another ASP.NET application ?
Anyways to post data from a web form to another you can Add PostBackUrl="<YOUR_FORM_Path>" property to the submit button or use Server.Transfer and set the preserveForm parameter to True (for example Server.Transfer("<YOUR_FORM_Path>", True) )
Now to read post data you can use Request.Forms("<your_controlid>") to access value for a specific control
Hope this helps.
|
|
|
|
|
|
HttpWebRequest hReq = (HttpWebRequest)HttpWebRequest.Create(ReqUrl);
HttpWebResponse hResp = (HttpWebResponse)hReq.GetResponse();
Stream str = hResp.GetResponseStream();
Can you be more specific about your problem??????
|
|
|
|
|
|
hi,
can anybody tell how i can use
sesssion in window applications
(syntax)
thnks
Afreen
|
|
|
|
|
afreen taj wrote: can anybody tell how i can use sesssion in window applications
There is no "Session" object in windows application..
Why do we want to use "Session" in Windows Application???
|
|
|
|
|
|
Hi all,
I am studying on using google maps to integrate into my web application..my need is to show "Get directions", search nearby and Save to my maps on a marker..
Thanks,
<< >>
|
|
|
|
|
I have the following code in my global.asax file. The reasons I create a page object and pass it is because my error reporting code requires a page object which it then uses parts of to build the report. Now obviously this method provides no page details. Is it possible to get the last page viewed and send that instead of a NULL page.
Otherwise is it possible to send some form of machine specific information via my error report. The error report code lies in a seperate vb file.
Thanks in advance
' Code that runs when an unhandled error occurs<br />
Dim ex As Exception = Server.GetLastError<br />
Dim page As Page = Nothing<br />
<br />
Emailer.ErrorEmail(ex, page)<br />
<br />
Server.Transfer("~/Error_Page.aspx", False)
|
|
|
|
|
HI, I used timer control in my page.
each 10 second i show one of some pics in my page by timer control.
problem is here, when i am scrolling in my page, when pic change, page scroll to top of page (my images change in top of page).
any one has Idea about it?
|
|
|
|
|
I'd like to use "smart client" for listing what software someone who visits my website uses.
For example, if you visit my homepage, my program will run to check your software for security.
and then my program compare your software information and my DB that has some information.
If you have software which has security problem, my program will earn you.
A problem is CAS.
I've searched many information about CAS over the internet.
but I can't fix it.
If you know sites which has information of CAS, plz tell me
have a good day!!
Nothing!! But gonzo!!
|
|
|
|
|
Real Coder wrote: I'd like to use "smart client" for listing what software someone who visits my website uses.
Smart Client Software Factory [^] or SmartClient, a commercial Ajax framework [^]??
Real Coder wrote: if you visit my homepage, my program will run to check your software for security.
Are you trying to get the information of client machine from your website?? Actually, it won't work unless those users added your website in the trust list....
Real Coder wrote: A problem is CAS.
No idea about what CAS is...
|
|
|
|
|
Hi,
The identity field of one of my SQL DB tables is a bigint, using ADODB to query the DB based on this bigint works fine in my XP machine, but gives me a "Bad variable type" error when I use my app in a W2000 machine.
The W2000 machine has every service pack issued by MS, what could be the problem?
Thank you!
|
|
|
|
|
Where do you get this error? in code or stored procedure?
Can you show us your ADODB query?? Why are you using ADODB instead of ADO.NET??
Are you using Authorization Manager in your project??
|
|
|
|