|
 Thank you so much Friend!!!
It is working well with the changes you have suggested.
I also have made the following changes:
<br />
<br />
'Class Definition<br />
<br />
<Serializable() , Xml.Serialization.XmlInclude(GetType(Photos))> _<br />
Public Class SitePhotos<br />
Private _Outdoordesc As String<br />
Public Property Outdoordesc() As String<br />
Get<br />
Return _Outdoordesc<br />
End Get<br />
Set(ByVal value As String)<br />
_Outdoordesc = value<br />
End Set<br />
End Property<br />
<br />
Private _ShelterEntrance As String<br />
Public Property ShelterEntrance() As String<br />
Get<br />
Return _ShelterEntrance<br />
End Get<br />
Set(ByVal value As String)<br />
_ShelterEntrance = value<br />
End Set<br />
End Property<br />
<br />
'Arraylist to store photo descriptions<br />
<br />
Public PhotoList As New System.Collections.ArrayList<br />
<br />
Public Sub AddPhoto(ByVal photoObj As Photos)<br />
PhotoList.Add(photoObj)<br />
End Sub<br />
<br />
Public Sub RemovePhoto(ByVal range As String)<br />
Dim _pht As Photos<br />
'Dim i As Integer<br />
<br />
<br />
For Each _pht In _PhotoList<br />
<br />
If _pht.posRange = range Then<br />
PhotoList.RemoveAt(PhotoList.IndexOf(_pht))<br />
End If<br />
<br />
Next<br />
<br />
End Sub<br />
<br />
<br />
End Class<br />
<br />
'Structure of each photo description<br />
Public Structure Photos<br />
Public Pos As Integer<br />
Public Desc As String<br />
Public posRange As String<br />
End Structure<br />
<br />
<br />
<br />
'Code for serialization<br />
<br />
Dim extraTypes(0) As Type<br />
<br />
extraTypes(0) = GetType(SitePhotos)<br />
<br />
Dim xSerializer As XmlSerializer = New<br />
XmlSerializer(GetType(GeneralSiteInfo.SitePhotos), extraTypes)<br />
<br />
Dim xWriter As StringWriter = New StringWriter()<br />
<br />
' Since the serialization can exception, we'll encase it in a try/catch<br />
' mechanism, so we can report the error properly<br />
<br />
Try<br />
xSerializer.Serialize(xWriter, objPhotos)<br />
<br />
'xmlSitePhotos is a hidden control to which i can store value. <br />
<br />
_xmlSitePhotos.Value = xWriter.ToString()<br />
<br />
Catch ex As Exception<br />
<br />
MsgBox(ex.ToString())<br />
'MsgBox("Could not serialize Site Photos", MsgBoxStyle.Critical, "Error<br />
Saving Site Photos")<br />
<br />
End Try<br />
<br />
xWriter.Close()<br />
<br />
<br />
|
|
|
|
|
the button I had in mind is something like a piano key that produces sound when pressed...
First i would like to know d codings on how to play a sound file (winamp) by clicking a button in a vb2003 form........
I might want to have a few of those, each playing a different note, (like button A would play file A)---i have a few files for each note already.I just don't know d coding to play those file in the event button A is pressed.And what if my sound files are all .mdi (MIDI)format??
The nex thing is, once i've pressed buttons A, B and C in sequence, i want it to be saved into the database---and i would like to play d saved sequence from database (sql server) later.So, can any kind soul out there please show me d codings??
Thanx!!
|
|
|
|
|
Bonjour,
1°) j'aimerais savoir comment reconnaître d'avance un répertoire en lecture
seul sans devoir attendre le code erreur de retour en tentative d'écriture
sur celui-ci comme on peut le faire pour savoir si un fichier est système,
archive, lecture, caché.
2°) j'aimerais savoir aussi comment détecter les autorisations (permissions,
comptes autorisés) d'écriture sur un répertoire sans devoir attendre le code
erreur de retour en tentative d'écriture sur celui-ci comme on le fait pour
un fichier.
Cette question est indépendante de la première car le répertoire peut être
en lecture/écriture mais que pour certaines personnes donc inutile d'aller
plus loin s'il est déjà en lecture seul.
j'ai essayé par le code suivant différents tests:
Dim FolderBrowserDialog1 As FolderBrowserDialog = New FolderBrowserDialog()
Dim MyAttr As FileAttribute
If FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
MyAttr = GetAttr(FolderBrowserDialog1.SelectedPath)
MsgBox(MyAttr.ToString) 'me retourne Directory
MsgBox(File.GetAttributes(FolderBrowserDialog1.SelectedPath).ToString)
'me retourne Directory
Dim information As System.IO.FileInfo
information =
My.Computer.FileSystem.GetFileInfo(FolderBrowserDialog1.SelectedPath)
MsgBox(information.IsReadOnly) 'me retourne toujours false même si le
répertoire est en lecture seul
End If
d'avance merci à tous
|
|
|
|
|
CP is an English-speaking board, and the French/English babelfish translator isn't doing a good job.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Bonjour - pardonnez/excusez moi, je parle un petite peu de Francais (je suis tres desolate) ...
pour >> 1°) j'aimerais savoir comment reconnaître d'avance un répertoire en lecture seul sans devoir attendre le code erreur de retour en tentative d'écriture sur celui-ci comme on peut le faire pour savoir si un fichier est système, archive, lecture, caché.
regardez http://www.codeproject.com/file/fileinfo.asp[^]
et pour 2°) j'aimerais savoir aussi comment détecter les autorisations (permissions,
comptes autorisés) d'écriture sur un répertoire sans devoir attendre le code
erreur de retour en tentative d'écriture sur celui-ci comme on le fait pour
un fichier.
regardez (peut-être) http://www.devx.com/cplus/Article/16711[^]
essayez svp de parler anglais, ici
'g'
|
|
|
|
|
Load DEnvAparoAtt
With DEnvAparoAtt
If .rsDcmd_OneSubjAtt.State <> 0 Then .rsDcmd_OneSubjAtt.Close
End With
Rpt_SpecificSubjectAtt.Sections(2).Controls(2).Caption = cmb_fac.Text & " ( " & cmb_group.Text & " ) Part-" & cmb_part.Text & " Section ( " & cmb_sec.Text & " ) " & cmb_shift.Text & " " & cmb_Ses.Text & " Student Attendenace For " & Cmb_subject.Text
Rpt_SpecificSubjectAtt.Refresh
If Rpt_SpecificSubjectAtt.Visible = False Then Rpt_SpecificSubjectAtt.Show
i write this code and the data report not show refresh report?
|
|
|
|
|
Hi
I want to use C++ .net based class library in my vb.net project.
there is class library called "CClass" it contain class called "Class1"
i wrote the code in form.vb
Dim obj As New Class1
but it gave me an error " Statement is not valid in a namespace."
guys plz help me.
|
|
|
|
|
|
hai every body,
am using VS 2005 and using vb.net, vb is my code begin, my problem is in one combo box i was given all the months(like Jan 07, Feb 07...........,Dec 10)on the next Text box it should automatically retrieve no of days ie 30 or 31 am trying to write for combo changed event and also combo click event But it wont work. How To Solve my issue Please help
|
|
|
|
|
urtextboxname.text=urcomboboxname.selectedindex.text
or simply write
urtextboxname.text=urcomboboxname.text
|
|
|
|
|
Thanks For Your Reply. But It wont work. could you read my question?
If the combo box value is jan 07 then the next text box would automatically changed to 31, if the combo value is feb 07 then the text box value automatically changed to 28. Is it Possible. Please help me?
|
|
|
|
|
Try starting with:
On selectedindexchanged:
Dim subStr As Integer<br />
If Me.ComboBox2.Text.Contains("jan") Then<br />
subStr = Me.ComboBox2.Text.Substring(Me.ComboBox2.Text.IndexOf("n") + 1, 3)<br />
Me.TextBox1.Text = DateTime.DaysInMonth("20" & subStr, 1)<br />
ElseIf Me.ComboBox2.Text.Contains("feb") Then<br />
subStr = Me.ComboBox2.Text.Substring(Me.ComboBox2.Text.IndexOf("b") + 1, 3) '1. note the change in the letter within the index of<br />
Me.TextBox1.Text = DateTime.DaysInMonth("20" & subStr, 2) '2. note the change in the second part of this daysinmonth.<br />
End If
Do for each month. The subStr part of this code extracts the year, assuming the indexof letter is the last the only one in the month component and also assuming that there is a space between the month and year and that the year is in a 2 number format. Please note that contains() is case sensitive and needs to be specific. If you do the year as 2007 as oppose to 07 then the "20" part must be removed from the daysinmonth part of the code.
Posted by The ANZAC
|
|
|
|
|
yest it so easy
Function MonthDaysNo(cmbstr As String) As Integer
dim str as string
str=left(cmbstr,3)
Select Case str
Case "Jan":
urtxtboxname.text="31"
Case "Feb":
Dim Mydate as DateTime = DateTime.Now
Dim MyString As String = MyDate.ToString("yyyy")
dim yr as integer
yr=cint(Mydate)
If yr Mod 4 Then
urtxtboxname.text = 29
Else
urtxtboxname.text = 28
End If
Case "Mar":
urtxtboxname.text="31"
Case "Apr":
urtxtboxname.text="30"
Case "May":
urtxtboxname.text="31"
Case "Jun":
urtxtboxname.text="301"
Case "Jul":
urtxtboxname.text="31"
Case "Aug":
urtxtboxname.text="31"
Case "Sept":
urtxtboxname.text="30"
Case "Oct":
urtxtboxname.text="31"
Case "Nov":
urtxtboxname.text="30"
Case "Dec":
urtxtboxname.text="31"
End Select
End Function
then in the item change change call this function by passing argument urcombobox.text
|
|
|
|
|
Actually it's even easier
'Date to test
Dim stringDate As String = "sep 07"
'Date object
Dim parsedDate As Date
'If our string is valid date show days in month
If Date.TryParse(stringDate, parsedDate) Then
MsgBox(Date.DaysInMonth(parsedDate.Year, parsedDate.Month))
End If
From what I can tell the 'TryParse' method will except 3 letter abbreviations for the month as well as the full name. It won't except 'sept' however so I hope that's not an issue. If it is you could do it a little differently by making your own enumerator.
Private Function Days(ByVal text As String) As Integer
Dim split As String() = text.Split
'An error could occur so catch it and return -1
Try
Dim month As Integer = [Enum].Parse(GetType(Month), split(0).ToUpper)
Dim year As Integer = CInt("20" & split(1))
Return Date.DaysInMonth(year, month)
Catch ex As Exception
Return -1
End Try
End Function
Private Enum Month
JAN = 1
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEPT
OCT
NOV
DEC
End Enum
|
|
|
|
|
Thanks A lot it was working very nice. thanks for all the others for your reply. thanks
|
|
|
|
|
Hi there!
Just I want to know how to add excel file data into Oracle Database table using VB6.0?
I appreciate if any one there to help me asap.
thanks and regards
M. YASEEN
|
|
|
|
|
use this link and get idea from this example
ww.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=9042&lngWId=4
|
|
|
|
|
I would like to write a program that tells me how long my computer has been running and write this to a text file. I have found out browsing msdn that you need to use "Systemuptime" but does not give any SIMPLE WAY of doing this.
Would appreciate someone showing me the light at the end of the tunnel, so i can find my way home.
|
|
|
|
|
|
Thanks for the reply,
After a bit of research I got it to do want i want .
Now i can get on with the next bit.
|
|
|
|
|
How can i run my application in safe mode? Do i need to create service? If true then please can anyone send me sample service becose i have never bin working with any of them.
Thanks...
|
|
|
|
|
Uhhh...What do you mean "Safe Mode"?? Windows doesn't have a safe mode that you can run just one application in. It runs the entire O/S in safe mode, meaning stripped down, only the basic essentials and generic drivers for the basics.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave.K. be a friend!
You know what i mean if i asked that i have to create a service, i need that it runs in safe mode like in windows so i enter safe mode and my application starts up automatically...
Understand?
Thanks... Dave.K.
|
|
|
|
|
No. All services in Windows, that are not essential to running Windows in Safe Mode do not start. AFAIK, you'll have to start it manually in Safe Mode. Why is this even a concern when Safe Mode is rarely ever used??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am building an security program that locks system untill you enter password buth if you go to safe mode you can delete it from startup and enter the windows... please help me...
|
|
|
|