|
hello,
i have an XML file which is located in the root dir of my project.
i want to read it via a regular class ( not connected to a web page. i use it as a singleton for various services)
when i put only the file name , i get c:\windows\system32\filename.xml
how can i retreive the current dir of the website?
tnx,
avi
|
|
|
|
|
Server.MapPath(YourFile) ?
|
|
|
|
|
Server is not recognized there because the class is not part of a webpage,
so what should i do ?
|
|
|
|
|
System.Web.HttpContext.Current.Server.MapPath("YourFieName")
|
|
|
|
|
ok , it works.
what if i have more than one file with same name at my project?
what will the value be ?
|
|
|
|
|
is that possible to have files which has same name in a folder ... I dont think so ...
|
|
|
|
|
i see, so it looks on the current path i am in and not also in its subs
ok , thanks
modified on Tuesday, April 28, 2009 6:35 AM
|
|
|
|
|
Use the following code
//Gets the physical path of the application directory
string path = System.Web.HttpRuntime.AppDomainAppPath;
//Return the file names in the application folder
string[] myFiles = System.IO.Directory.GetFiles(path);
|
|
|
|
|
You can use
Server.MapPath(.)
to retrive current directory of you website.
|
|
|
|
|
how to download wallpapers in ASP.net using C#
plz help
|
|
|
|
|
shaludekate wrote: how to download wallpapers in ASP.net using C#
ASP.NET is not built for wallpaper download.
|
|
|
|
|
|
Hi all,
In testing of my web application, the customer has entered in a multi line text box a text from more than 200 letters with no spaces in between words (smart customer Ah!)and i have sat the width in %. When saving the design of the page was corrupted and the width of page became equal the width of the textbox. i have tried wrap property but didnt solve my issue. Still the width of page is affected by width of textbox.
Is ther a way that i can prevent page width from growing with textbox width other than putting textbox width in pixels. thanks
|
|
|
|
|
Hi, can you post your code?
I think its better to use CSS.
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
<asp:textbox id="txt" runat="server" width="95%" xmlns:asp="#unknown">
TextMode="MultiLine" Wrap="False" />
i have used both wrap=true and wrap=false. didnt work!!!!!!!!!!!
|
|
|
|
|
Hi guy,
The 'nowrap' property won't take effect on the width in % but px.
You can set the width of controls in px and the same time set the 'nowrap' property to controls.
Welcome to www.softwaretree.net!
This website is generated completely by static html pages transforming technology.
You can find many excellent audio/video tools there!
|
|
|
|
|
i cannot put width in pixels especially with different users with different resolutions it will mess up the design.
|
|
|
|
|
Try by providing the style value...
<asp:textbox textmode="MultiLine" id="TextBox1" style="overflow: auto;" xmlns:asp="#unknown">
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
width =95% might not work
Better create a class in your css and add CssClass='createdClass' to your TextBox
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Fix the text box control's width in pixels not in percentage. It will solve your issue.
Either you love IT or leave IT...
|
|
|
|
|
Hi,
How to Encode or Encrypt the whole url in address bar , if anyone knows plz answer me..
Example:
http://www.abc.com/script/Forums/first.aspx?id=10
the above url is my sample url i wanted to be like this,
http://www.abc.com/Encrypted values
kannak
|
|
|
|
|
Hi, you can use my function
Private _bitEncrypt As Byte()
Public Function EncryptQueryString(ByVal queryString As String) As String
_bitEncrypt = ASCIIEncoding.ASCII.GetBytes(queryString)
Dim encryptedQueryString As String = Convert.ToBase64String(_bitEncrypt)
Return encryptedQueryString
End Function
Public Function DecryptQueryString(ByVal queryString As String) As String
_bitEncrypt = Convert.FromBase64String(queryString)
Dim decryptedQueryString = ASCIIEncoding.ASCII.GetString(_bitEncrypt)
Return decryptedQueryString
End Function
ex:
encryptquerystring(your path or web address)
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
Hi,
Thanks for responding me, but am getting error, i was used the code like this as follws,
In Page first there is a link button , if i click the link btn second page will be loaded.
In First page,
private sub LinkButton_click()
Dim strQ As String = EncryptQueryString("aspxsecond.aspx")
Response.Redirect(strQ)
end sub
Public Function EncryptQueryString(ByVal queryString As String) As String
_bitEncrypt = ASCIIEncoding.ASCII.GetBytes(queryString)
Dim encryptedQueryString As String = Convert.ToBase64String(_bitEncrypt)
Return encryptedQueryString
End Function
but i am getting error like, The resource cannot be found.....
kannak
|
|
|
|
|
|