Click here to Skip to main content
15,921,452 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Saving Images Pin
John Ad23-Jul-08 2:14
John Ad23-Jul-08 2:14 
GeneralGantt chart control needed Pin
Iman Attarzadeh23-Jul-08 0:33
Iman Attarzadeh23-Jul-08 0:33 
GeneralRe: Gantt chart control needed Pin
jzonthemtn23-Jul-08 1:27
jzonthemtn23-Jul-08 1:27 
QuestionNot actually a programming question, more a general info requirement Pin
Dalek Dave23-Jul-08 0:29
professionalDalek Dave23-Jul-08 0:29 
AnswerRe: Not actually a programming question, more a general info requirement Pin
ChandraRam23-Jul-08 2:58
ChandraRam23-Jul-08 2:58 
QuestionA VB Service Pin
Stephen Lintott22-Jul-08 23:24
Stephen Lintott22-Jul-08 23:24 
AnswerRe: A VB Service Pin
Dalek Dave23-Jul-08 0:32
professionalDalek Dave23-Jul-08 0:32 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:11
Stephen Lintott23-Jul-08 1:11 
Sorry never thought about the code...
The answer is yes and here is some code to go with it.

Dim sw As New System.IO.StreamWriter(ConfigurationManager.AppSettings("IPAccountingLocation") & routerIP & ".txt")

Try
sw.Write(result)
Catch ex As Exception
Finally
sw.Close()
sw.Dispose()
End Try

Try
Dim path As String
path = ConfigurationManager.AppSettings("AppServer")
Dim CurrentDate = DateTime.Now
path = path + "\" + CurrentDate.year.ToString
Dim DateStr = ""
If CurrentDate.Month.ToString = "1" Then
DateStr = "Jan"
End If
If CurrentDate.Month.ToString = "2" Then
DateStr = "Feb"
End If
If CurrentDate.Month.ToString = "3" Then
DateStr = "Mrt"
End If
If CurrentDate.Month.ToString = "4" Then
DateStr = "Apr"
End If
If CurrentDate.Month.ToString = "5" Then
DateStr = "May"
End If
If CurrentDate.Month.ToString = "6" Then
DateStr = "Jun"
End If
If CurrentDate.Month.ToString = "7" Then
DateStr = "Jul"
End If
If CurrentDate.Month.ToString = "8" Then
DateStr = "Aug"
End If
If CurrentDate.Month.ToString = "9" Then
DateStr = "Sep"
End If
If CurrentDate.Month.ToString = "10" Then
DateStr = "Oct"
End If
If CurrentDate.Month.ToString = "11" Then
DateStr = "Nov"
End If
If CurrentDate.Month.ToString = "12" Then
DateStr = "Dec"
End If
path = path + "\" + DateStr
Dim strRouterName As String = ""

' Just to get the router name
Dim con As New SqlClient.SqlConnection(ConfigurationManager.AppSettings("SQLConn"))
con.Open()
Dim selectName As New SqlClient.SqlCommand("Select RouterName from tblRouters where RouterIP=@RouterIP;", con)
Dim sqlParam As New SqlClient.SqlParameter("@RouterIP", SqlDbType.NVarChar)
sqlParam.Value = routerIP
selectName.Parameters.Add(sqlParam)
Dim sqlReader As SqlClient.SqlDataReader
sqlReader = selectName.ExecuteReader
If sqlReader.Read Then
strRouterName = sqlReader("RouterName")
End If
sqlReader.Close()
con.Close()


path = path + "\" + routerIP + "-" + strRouterName
path = path + "\" + CurrentDate.Day.ToString

Dim dir As New System.IO.DirectoryInfo(path)
dir.Create()
path = path + "\" + routerIP + "-" + CurrentDate.Hour.ToString + "-" + CurrentDate.Minute.ToString + ".txt"
Dim sw1 As New System.IO.StreamWriter(path)
sw1.Write(result)
sw1.Close()
sw1.Dispose()

Stephen Lintott Bsc IT (RAU)
GeneralRe: A VB Service Pin
Dalek Dave23-Jul-08 1:39
professionalDalek Dave23-Jul-08 1:39 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:44
Stephen Lintott23-Jul-08 1:44 
GeneralRe: A VB Service Pin
zahedonline23-Jul-08 1:49
zahedonline23-Jul-08 1:49 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:55
Stephen Lintott23-Jul-08 1:55 
QuestionHow do I populate a Strongly Typed DataSet with XML Pin
penguin500022-Jul-08 23:03
penguin500022-Jul-08 23:03 
AnswerRe: How do I populate a Strongly Typed DataSet with XML Pin
Mycroft Holmes23-Jul-08 14:02
professionalMycroft Holmes23-Jul-08 14:02 
QuestionDATETIMEPICKER IN VB.NET Pin
r_mohd22-Jul-08 22:57
r_mohd22-Jul-08 22:57 
AnswerRe: DATETIMEPICKER IN VB.NET Pin
ilprincipe23-Jul-08 1:19
ilprincipe23-Jul-08 1:19 
GeneralRe: DATETIMEPICKER IN VB.NET Pin
zahedonline23-Jul-08 1:54
zahedonline23-Jul-08 1:54 
AnswerRe: DATETIMEPICKER IN VB.NET Pin
brjames3223-Jul-08 1:33
brjames3223-Jul-08 1:33 
QuestionHow to detect if a removable storage device is write protected?? Please help... Pin
vbDigger'z22-Jul-08 21:44
vbDigger'z22-Jul-08 21:44 
AnswerRe: How to detect if a removable storage device is write protected?? Please help... Pin
Paul Conrad27-Jul-08 11:03
professionalPaul Conrad27-Jul-08 11:03 
QuestionSaving DataGidView data to Excel Pin
brjames3222-Jul-08 21:25
brjames3222-Jul-08 21:25 
AnswerRe: Saving DataGidView data to Excel Pin
brjames3223-Jul-08 6:27
brjames3223-Jul-08 6:27 
Questionhow to get combobox selected value in integer Pin
Kissy1622-Jul-08 21:24
Kissy1622-Jul-08 21:24 
AnswerRe: how to get combobox selected value in integer Pin
brjames3222-Jul-08 21:31
brjames3222-Jul-08 21:31 
GeneralRe: how to get combobox selected value in integer Pin
Kissy1622-Jul-08 22:00
Kissy1622-Jul-08 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.