Jump to content
Xtreme .Net Talk

tehon3299

Avatar/Signature
  • Posts

    156
  • Joined

  • Last visited

Everything posted by tehon3299

  1. How can I parse through a filename and replace all the spaces with %20 so that I can allow the file to be downloaded?
  2. What is the code to allow a file to be downloaded from your webpage. I.E. I have C:/Documents and Settings/Files/song.mp3 How can I have a link so that file can be downloaded? I am URLEncoding the string to get rid of the spaces. Thanks
  3. OK..I got it. But now it's putting http://localhost/ infront of my path. I.E. http://localhost/C:/documents and settings...and it can't find the file to download.
  4. That works great. Thanks!
  5. I am using an ASPX page to write my HTML on a page and I am using an HREF but whenever it gets to a space, i.e. Documents and settings, it cuts off the HREF after Documents. How do I fix this?
  6. Directory Filenames I am using the following code to get the files in a directory. Dim sFiles() As String = System.IO.Directory.GetFiles("C:\Documents and Settings\matt\Desktop\Songs\", "*.mp3") Is there anyway to return JUST the filename and not the whole path? Thanks
  7. If this is on an ASPX page, how can I make this print in the body of the page?
  8. Can you give me an example? I've been looking but can't find an example.
  9. I am using this method to get all the files in a directory: Dim sFiles() As String = System.IO.Directory.GetFiles("C:\") How do I print out all of the names in sFiles? Thanks
  10. Robby, I just want to be able to click a button on my aspx page and have it look at the directory path and take all the filenames and put them in an SQL table.
  11. How can I read the all the files in a directory (with NO subfolders) and as I read the filenames, put them in a database in SQL?
  12. Thanks. I also figured out that I needed to convert it to a string by saying (string)Session["userName"]; Thanks again
  13. Can you reference session variables the same in C# as in VB? It seems to not like when I say: string user = Session("userName"); It says something about: CS0118: 'System.Web.UI.UserControl.Session' denotes a 'property' where a 'method' was expected and points to that line. Any ideas?
  14. I used that code and it tells me that MyConnection is not declared. I'm importing the same things for SQL in VB and C#. Do I need to import something else?
  15. I am using the code below (VB) to insert things into an SQL database. I want to use this code on a C# page. How can I do this? Dim MyCommand As New SqlCommand Dim MyConnection As New SqlConnection Dim MySQLDataAdapter as New SqlDataAdapter Dim SessionCmd As String SessionCmd = "INSERT INTO tmPicIndex (UserID, PicName, PicDesc) VALUES ('" & user & "', '" & savename.Value & "', 0)" MyConnection = New SqlConnection("server=(local);database=PictureShare;Trusted_Connection=yes") MyCommand = New SqlCommand(SessionCmd, MyConnection) MyCommand.Connection.Open() Try MyCommand.ExecuteNonQuery() Catch Exp As SQLException If Exp.Number = 2627 Else End If End Try MyCommand.Connection.Close()
  16. I have an ASCX page in C# for file uploads and an ASPX page that references the ASCX page. I need to reference a variable in the ASCX page that is public. How can I reference that on my ASPX page??
  17. OK - I am behind a router in my home and therefore when I view my webpage (running on IIS) I need to put in localhost, or my private ip, or my computer name. But now that I am hosting more than 1 web site with IIS, I can not use my computer name because it requires a domain name. How can I fix this? Anyone? Thanks
  18. Can you please tell me how I would be able to read the whole contents of a folder of pictures and output a list of the files on an aspx page?
  19. How do you set the name of the folder and where you want it to be created?
  20. How can I create directories on my aspx page?
  21. Thanks a lot guys. I'm going to find a good ping class and put it in the Code Library. I didn't even think of finding a class already listed.
  22. I am wondering how to fire DOS Commands from an ASPX page? What would the syntax to like ping or something? Thanks
  23. How could I read from an SQL Table and insert that data into the BODY string of the following code: Dim from As String = txtFrom.Text Dim mailto As String = "tehonica@oswego.edu" Dim subject As String = "Tehon.Net Inquiry" Dim body As String = txtMessage.Text SmtpMail.SmtpServer = "mail.oswego.edu" SmtpMail.Send(from, mailto, subject, body) Thanks
  24. You're correct. I took that code from another page that I am using. I need to put this in a button click event. Thanks for the insight!
  25. I am using the following code: Sub Page_Load(sender as object, e as eventargs) Dim from As String = "tehonica@oswego.edu" Dim mailto As String = Session("email") Dim subject As String = "Tehon.Net Account Confirmation" Dim body As String = "Thank you for registering with [url]http://www.Tehon.Net[/url]" SmtpMail.SmtpServer = "mail.oswego.edu" SmtpMail.Send(from, mailto, subject, body) End Sub This works perfect but I would like to now use the email address from an ASP textbox instead of hard coding it. How can I do this?? Thanks
×
×
  • Create New...