|
hi
i want to create a new folder in my site with programming
when an event fires.
how i can do it with c#?
thanks
|
|
|
|
|
using System.IO;
and in your event handler:
DirectoryInfo r = new DirectoryInfo("myRootPath");
r.CreateSubdirectory("MyFolder");
Of course, as you've asked in the web development area, you need to make sure that your web app has permission to create a folder at this location.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am developing a automated web data extraction program. One of the pages (POST) gets redirected. If I disable automatic redirection and attempt a GET to the redirection page, the server does not come back with the data (timeout). If I allow the redirection to occur, when I attempt to read the data (redirection is GET) I often end up reading a partial page (the transaction has not completed).
How can I tell the transaction completed for:
pFile = pServer->OpenRequest("POST", ....
:
pFile->SendRequest(NULL,NULL,(LPSTR)(LPCSTR)post_string,post_string.GetLength());
pFile->QueryInfoStatusCode(dwRet);
if (dwRet == HTTP_STATUS_OK) { <--- the status is OK even though the redirected read is in action at the time!
pFile->Read(htm_read_buffer, BUFFER_SIZE);
}
Thanks in advance!
|
|
|
|
|
Getting "the server returned an invalid or unrecognized response" error on the code listed below. The url is an asp page on my company's qa server that takes an
xml request, processes it and returns an xml response. The code works fine
at work when run from my win 2000 machine on our LAN but one of our clients
is complaining about the above error, he's using a win xp machine. I can reproduce the error if I take the code home and run it from my xp machine but I'm not a web developer so I haven't got a clue how to make it work. I searched msdn and found a few items regarding the above error, most of it I didn't understand but some of it suggested different IE security settings which I tried to no avail.
Any advice would be appreciated ...
var SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS = 2;<br />
var SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056;<br />
<br />
var url = "someurl.asp";<br />
var oXmlHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");<br />
var domReq = new ActiveXObject("Msxml2.DOMDocument.4.0");<br />
<br />
domReq.async = false;<br />
domReq.loadXML(document.getElementById("req").value);<br />
<br />
oXmlHttp.open("POST", url);<br />
oXmlHttp.setOption(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS,SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);<br />
oXmlHttp.setTimeouts(30000, 30000, 30000, 90000);<br />
<br />
oXmlHttp.send(domReq);
<br />
Thanks
Andrew Bleich
|
|
|
|
|
I found a workaround...
I replaced Msxml2.ServerXMLHTTP.4.0 with Msxml2.XMLHTTP.4.0.
(and got rid of the calls to setOption() and setTimeouts because they
are not supported by Msxml2.XMLHTTP.4.0)
Thanks for all your help anyway,
Andy
Andrew Bleich
|
|
|
|
|
Hi,
If I am writing a toolbar application for IE using VS.NET, how do I debug my application?
If I set the Project properties' Start Application value to C:\Program Files\Internet Explorer\iexplore.exe, it is a release version and hence I can't debug.
How can I launch IE from my project and still debug it?
-Thanks in advance
Hari
|
|
|
|
|
hi,
what are the components of web services.
Satish.
|
|
|
|
|
On what end ? Perhaps if you clarify your question a little, a better answer can be provided. Do you want to write one, consume one, or just generally know about them ? Have you tried google ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi Christian,
Actually this question was asked to me in an interview.He said their are four components and he claims that any one who does web services should know it.He just reveiled one that is SOAP and I am intreatsed to know about the other three and and want to learn about all the four components.
Satish.
|
|
|
|
|
Offhad, I guess if SOAP is one, he's talking about the different protocols involved. SOAP is XML over HTTP, basically. I reckon a google would give you more accurate technical terminology than I could offer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm working on a very large website page that needs javascript functions to be added dynamically - otherwise the page size will become prohibitive. The functions are being added with the text of the selected topic on the website. Unfortunately, the functions aren't accessible, as far as I can tell.
I used the simple test of adding a function dynamically - the file below errors out with "Object Expected" when I click on the second <a> tag. I need the alertMe() function to be accessible. Ideas?
************ Start of File ************
<HTML>
<HEAD>
</HEAD>
<BODY>
<script>
function getTheDiv(){
theDiv.innerHTML = "<script>function alertMe(){alert('Success!');}</script>";
}
</SCRIPT>
<a onclick="getTheDiv();">Click to Generate alertMe() function</a>
<divid="theDiv"></div>
<a onclick="alertMe();">Click to Test alertMe() function</a>
</BODY>
</HTML>
************ End of File ************
|
|
|
|
|
I know this is only your sample code, but I see no ID or NAME tags or even a DIV tag. Make sure you have those all set.
Then you can use the document.getelementbyid method to get a reference to the div
var oDiv = document.getelementbyid("myDiv");
oDiv.innerHtml += "function alertMe(){alert('Success!');}";
|
|
|
|
|
Hi there,
I have a question with regards to SQL injection attacks. I have a section where a user can add data to a SQL Server database. I am using classic ASP with stored procedures. Basically the stored procedure looks something like.
CREATE Procedure sp_InsertTitle
(
@TitleName varchar(50)
)
AS
INSERT INTO tblTitle
(
TitleName
)
VALUES
(
@TitleName
)
GO
If a hacker tries to enter something into my textbox like:
' UNION SELECT name, type, id FROM sysobjects;--
I would like to know how to chek for this kind of data because if I enter this into the textbox it adds the complete string (' UNION SELECT name, type, id FROM sysobjects;--) to the database.
I would appreciate it if someone could help.
Thanks
Brendan
|
|
|
|
|
|
I have read that already, but it doesn't answer all my questions.
|
|
|
|
|
First, I should let you know that I never worked with Classic ASP and ADO, just the .NET variety, so if I make an incorrect assumption you can let me know.
If Classic ASP supports parameters on the command that it sends to the database then this will be okay because this separates the command from the data. So, if the data is dodgy it arrives at the stored procedure already wrapped as a parameter. If, however, the Stored Procedure is being called from ASP in the form EXEC sp_InsertTitle '[Value From Textbox goes here]' then you will have the potential for an attack to occur.
The part you should watch out for is the possibility of Second Order Injection Attacks. This means that the initial data is input into the data and it sits there quietly not doing anything. Then at some later point the column value is used to dynamically generate some SQL command. If you are doing that then there is a possibility of an attack at that point. This is actually harder to track down because the attack occurs but the payload does no damage until sometime later.
Does this help?
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hi there,
I am struggling with a piece ofcode. I am using using classic ASP (which is the normal ASP,and not ASP.NET). I am using SQL Server 2000 as the database. I am using stored procedures.
I am using the command object when adding data to the database. My code looks like this:
objCmd.Parameters.Append objCmd.CreateParameter("@ContactCommQues", adWChar,
adParamInput, 16, Request.Form("txtQuesComments"))
txtQuesComments is a input control. The value 16 in the CreateParameter method I took because when you define a field with the ntext datatype, it automatically inserts a 16 for the size of that field. OK, coming back to the CreateParameter method, the value 16 represents the size, and the MSDN library defines this field as "A Long value that specifies the
maximum length for the parameter value in characters or bytes". Now the problem is that I do not know what the length of the <textarea> will be, it might be a long letter or article, maybe it can be 10000 characters long. Do you know how I can solve this? What I thought wasmaybe I should replace value 16 with something like Len(Request.Form("txtQuesComments")). This seems to work, but is this the only way?
Here is a shortened version of my stored procedure:
CREATE Procedure sp_InsertContact
(
@ContactCommQues ntext
)
AS
INSERT INTO tblContact
(
ContactCommQues
)
VALUES
(
@ContactCommQues
)
GO
Thanks
|
|
|
|
|
Hi there,
I have a problem with my regular expression functions. The thing is that it accepts alpha characters and numeric characters where I only want it to accept alpha characters from a thru z, and A thru Z. So Brendan would be valid, and Brendan1 would be invalid.
My test function in my .js file
function isOnlyAlpha(strString)
{
var re = /[a-z]/i;
var isValid = re.test(strString);
return isValid;
}
And my calling function from my .asp page
if(!isOnlyAlpha(form.txtFName.value))
{
alert('Valid first name required!');
form.txtFName.focus();
return false;
}
My regular expression looks right to me! What do you think.
Brendan
|
|
|
|
|
You are testing to see if *any* of the characters is alpha - not to see if *all* of the characters is alpha.
Try
var re = /[0-9]*/;
|
|
|
|
|
I have form with the follows parameters :
I want to address to the form element from JavaScript :
document.form.var[1].checked=true;
But in this case i retrieve an error :
document.form.var.1 is not an object !
HOW COULD I REFER to the FORM's ELEMENTS ?
|
|
|
|
|
you have used this...
document.form.var[1].checked
write form name instead of just form
i.e
say you have .....
then write as
document.myform.var[1].checked
try this...
Abhijeet Jadhav
|
|
|
|
|
Hello
Does anybody know some JavaScript/HTML component, which behave like a programming text editor ? What i mean is to provide syntax coloring for JScript/VBScript languages on the web page, and let the user to write scripts online, like in IDE. Surely TEXTAREA would be enough, but i'd like to make it a bit fancy.
|
|
|
|
|
First off let me say i am NOT a javascript developer i SUCK at it i only scrape by when i absolutely need to use a client side script. not to say i can't write a script that works i'm just bashing my head off the monitors trying to figure out how to do this.
basically i wrote a quick little javascript for my girlfriend's personal website that uses the onMouseOver event to show and enlarged picture and a description of said picture when the mouse is moved over a thumbnail
the script function is simply passed the ID of the thumbnail and it uses the GetElementByID and the GetAttribute and SetAttribute to change the Large Display Picture and the textbox input field.
this all works beautifully
now for the problem
we have 4 cats and one overly used digital camera so there's a ton of pics on her site now her page is in frames and when the picture page loads you have to scroll to the bottom to see all the thumbnails which scroll the large display picture right out of view... this kindof defeats the purpose of the script now me being an ASP.NET fan would just throw in two panels set some attributes and i'd be done.
but her webserver doesn't support ASP.NET
so i decided to split the page into two horizontially split frames the large pic and textbox in the top frame and the thumbnails in the bottom frame. now the problem is my script won't work and i have been searching everywhere on the web to find out how to access elements of one frame from another frame.
i left the script in the frame with the thumbnails since they are the ones that reference the function.
i just need to know how do i reach the large picture and the textbox elements in the other frame and change their attributes.
Sorry for the ramblin my brain is fried
Ryan
|
|
|
|
|
Hello,
can any body tell me solution for following.
What should I do so that google search engine
searches and display my web site in search result.
right now its searches by company name and by some
of word in web page but its not able to search every important word on page.
For that I have to do only URL registration or every individual key word registration for which I want to
redirect to particular page? and how it will be done?
Its require chane in coding or only registration to search engine will do?
I heve try some of sites but its not working.
regards
Khyati
regards
khyati
|
|
|
|
|
Khyati Asher wrote:
What should I do so that google search engine
searches and display my web site in search result.
Use Google AdWords[^]
|
|
|
|