|
Thanks, but I already have a connection, and I'm passing the id of the row to the function. I'd just like to get the data from that row and return it to the program I'm writting. There must be an easier way. Thanks
|
|
|
|
|
Thanks guys, but I guess it was to easy to answer, or you figured I needed to get it on my own, so I did. Thanks
|
|
|
|
|
Hello !
I develop a program which upload a file (max 10Mo) to a server with POST METHOD.
For little files, there is no problem. But for files of 6Mo and more, the upload don't finish. I think that I upload data too quickly. With Ethereal, I saw my data. There is a frame of 1452 bytes, after a frame of 96 bytes, another of 1452 etc...
Another software (perhaps writted in C/C++) upload the data with frames of 1024 bytes. And it works perfectly.
How can I change the data buffer of TCP in .NET 2 ?
I tried to change the "BufferSize" of my stream "rs" but no change.
I post a little part of my program :
Private request As HttpWebRequest
Const BufferSize As Integer = 1024
Dim content As Byte() = New Byte(BufferSize - 1) {}
Dim dataRead As Integer
Dim fs As Stream = getStream(Me.data)
Using rs As Stream = Me.request.GetRequestStream
While True
dataRead = fs.Read(content, 0, BufferSize)
If dataRead = 0 Then
Exit While
End If
rs.Write(content, 0, dataRead)
dataReads += dataRead
RaiseEvent PercentDone(dataReads, Me.data.Length)
End While
fs.Flush()
fs.Close()
End Using
Sorry for my poor english.
Thank you for reading.
|
|
|
|
|
Thanks in advance for reading this.
Let's say I have a file (file01) with this data in ASCII (ignore line col):
line01 123abc
line02 Header01 Starts blah var
line03 detail01 000001
line04 detail02 000002
line05 detail03 000003
line06 detail04 000004
line07 detail05 000005
line08 detail06 000006
line09 detail07 000007
line10 Header01 Ends
line11 Header02 Starts blah var
line12 detail01 000001
line13 detail02 000002
line14 detail03 000003
line15 detail04 000004
line16 detail05 000005
line19 Header03 Ends
Here's what I need to do:
1. traverse each line and modify some section of the line
(it could postion 10-20) according to some logic in a function.
2. For Header line, I need to know the last detail line for that header
of a section (it could postion 20-25). So for Header02 (line11) I would
need to grab the value '000005' (line16).
The result for file01 will have it's line modified accordingly.
The main question is how can I traverse down line by line, and
when I get to the Header, somehow get the value of the last detail line
for that header, and continue the next line after the header which
is the first detail line.
I know you can do this in C by creating a dummy pointer to point
to the header and then traverse to the last detail line and return the
value. And then destroy the pointer.
I just don't know how to do this is .NET.
Thanks in advance for your replies!
|
|
|
|
|
Completed my password storage program and down to the part where I would like to write the listview data to an XML file (for later encryption).
Cannot find anything that gives me an nice or usable example on how to do this using the listview control. Does anyone have example code for this or a place I can be directed to for more research?
Thanks, everyone.
- Harold
|
|
|
|
|
I used this artical and it was great.
http://www.knowdotnet.com/articles/serializationoflistviewtoxml.html
Good luck...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I saw that one and also found this article from the same author as well:
http://www.knowdotnet.com/articles/serializelistview-listbox.html
I can follow the code, but cannot get it working. I was hoping to find a working sample program that uses that or very simialr code to better understand how it works as well.
|
|
|
|
|
Hi,
By the looks of it creating a folder and password protect it seems a rare find. What I am trying to do is to create folders through VB.NET one for each person on a separate server drive and have it password protected. I have a database and I managed to create a folder for each record with a name found in Column1.
But now I need to set a password through code and possibly link it to column2.
Is this possible guys. I know there is the FileSystemWatcher and NotifyFilter but I dont know how to use them or if they will do the trick. Anyone has any idea please??
|
|
|
|
|
wrote: By the looks of it creating a folder and password protect it seems a rare find.
There's a reason for that. It "mostly" cannot be done. It kind of can, Microsoft released a free product to do that a while back, and 3 days later pulled it.
wrote: one for each person on a separate server drive and have it password protected
Imagine the total chaos if a person created 10 different folders, password protected them all with different passwords, and then called you to reset that password when they forgot them.
wrote: But now I need to set a password through code and possibly link it to column2.
Not possible since NTFS doesn't support this.
wrote: FileSystemWatcher and NotifyFilter
Has nothing to do with security of this kind.
Basically what you want to do isn't possible, for administrative reasons at the least. How it's properly done is to create a folder on the server, then assign the appropriate permissions for that users account to that folder and making sure noone else (except admins of course) have permission to that folder.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
okay David many thanks for your professional reply.
Our problem is that in our organisation we need to allocate one folder for each user. Now if the password protection isnt possible maybe there is another solution1. I was doing a search on the internet for this pssoibility and seems workable. It is this:
Create folders on server. Folder name will be the same as login name on the network. On user login his Folder will be visible on the desktop and he can store his files and subfolders in it. He will not have access to the Server and all folders created on it will be hidden. Only on boot up individual folder will be set to Normal for its user. On logging the folder will be sent to the server and marked as hidden.
Now I guess this involves Windows Services on which I have little experience. Can you see this solution feasible please?? Im kind of new in VB.NET windows manipulations so everything is a help.
cheers!
|
|
|
|
|
Doesn't windows already do this kind of thing when you setup remote profiles within a network. Each user has their own profile and when a user logs on Windows selects the correct profile across the network giving the user access to their own folder(s), drive mappings and so on, but locking out other folders. These folders can be mapped to things like "My Documents" and so on.
Unfortunately I don't really know the details about how to set that up, you are best asking a network administrator for help with that one.
|
|
|
|
|
focusit wrote: Create folders on server. Folder name will be the same as login name on the network.
So far so good. It's usually done under a shared folder on the server called, oddly enough, Home . The permissions on this folder are stripped for the Domain Users. On each individual folder under home, the folder inherits the permissions from its parent folder, meaning that noone (except an Admin) has permissions to any of the folders under home. For each individual folder under Home, you reinstate the permissions for that folders particular owner. This way, they can see their own home directory, but no others.
In your login script, you map a drive letter to the users Home\folder. Done, problem solved.
focusit wrote: On user login his Folder will be visible on the desktop
Usually not. Unless your login script, or something else, specifically creates a shortcut on the Desktop for the user.
focusit wrote: He will not have access to the Server
Unless you give the users permissions to other folder on the server and possibly map some drive letters for those areas.
focusit wrote: Only on boot up individual folder will be set to Normal for its user. On logging the folder will be sent to the server and marked as hidden.
You don't have to do any of this. You mark anything hidden or visible, ever. It turns into a administrative nightmare if you do.
focusit wrote: Now I guess this involves Windows Services on which I have little experience.
No, it doesn't. It's strickly Windows Networking. I suggest picking up a book on it before you even attempt to continue this. Anything you do in code is just going to needlessly complicate your situation.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave,
Many thanks for your reply. Right so the folder handling system I will leave that to the network manager.
Now we very often have 2 people working together on a file on the same PC logging naturally with one username. I have created an application to transfer the file to the other person's folder. It works fine on my computer. Now will this application still be possible if I change the path to the server with all the domain and permissions you suggested. I am only selecting a file with the Showdialogu Window and copying a file to the other person's folder. Is this possible?
Cheers
|
|
|
|
|
No, scince each user is the only person who has access to their own home folder. This CAN change if the user grants the other some rights to the folder, or creates a sub-folder and grants the other user rights to it.
The usual way around this is a shared folder that everyone has access to. They can create their own folders in there and collaborate using the files stored in that.
But that's also something you have to setup with your LAN Admin.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am writing an application that needs lots of things dynamically created, Labels etc.
Here is the code I use to add a label to the form:
Dim lblTitle as label
With lblTitle
.Left = 24
.Top = 24
.Width = 632
.Height = 48
.BackColor = Color.Black
.ForeColor = Color.White
.Font = New Font("Arial", fontsize, FontStyle.Regular)
.Enabled = True
.Text = "Title of the song"
.AutoSize = False
End With
controls.add(lblTitle)
I want to make a scrolling label, so I need to create a panel on the form, then create a label in the panel with a width wider than the panel width, and move the .left of the label to make it look as if it is scrolling.
I can do this when dropping the items onto a form normally, but not by dynamically creating them, please can someone help, I have been trying for days.
Thanks
|
|
|
|
|
You didn't create an instance of the label. Change your first line to this:
Dim lblTitle As New Label
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sorry, I did use: Dim lblTitle As New Label,
Bu, my question is, how to dynamically create a panel with a Label in it.
|
|
|
|
|
Create the panel using the same method, add it to the Controls collection of the form. Create the label the way you're doing it now but add it to the Controls collection of the Panel, not the form.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Excellent.
I used:
'panel1.controls.add(txtTitle)'
and it worked fine.
Thanks again
|
|
|
|
|
Set the parent property of the label to the panel you create. Set the parent property of the panel to the form on which you want it to appear. The labels location coordinates will be relative to the top left corner of the panel. If you want the panel to show on the form you must set its visibility property to true and call BringToFront. You must do the same for the label so it shows on the panel.
|
|
|
|
|
I am trying to write a DVD player in VB.net
I have used the WMP SDK and embedded WMP in a VB application. I can open an mpg file, avi etc, but when I load a dvd 'VIDEO_TS.ifo' file into the embeded WMP it plays, but without sound.
Here is the code I use to load the DVD into WMP:
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> Nothing Then
file = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.URL = file
End If
As I said before, the sound is heard, but no video is shown.
|
|
|
|
|
Does it play just using Windows Media Player?? Don't use your application to try and play it, just launch WMP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Yes, WMP works fine
Confusing....!
|
|
|
|
|
I have created a project that includes a dataset pointing to a SQL Server Table "Equipment". When I build my project I am getting the following errors in the Error List:
1.) Reference to a non-shared member requires an object reference - I've got several of these errors on the file Equipment_Dataset.vb (which VB.NET generated automatically for me). The real kicker is that the errors are in the Data Access Attributes.
i.e.
<system.diagnostics.debuggernonusercodeattribute()> _
Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tableEquipment = CType(Me.Table,EquipmentDataTable)
End Sub
The System has the squiggly blue underline attached to the Error message
2.) Data is not a member of String
Again, the error is located in the file Equipment_Dataset.vb (auto generated by VB), but this time the error is on the following code:
Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State
If ((Me.Adapter.UpdateCommand.Connection.State And System.Data.ConnectionState.Open) _
<> System.Data.ConnectionState.Open) Then
Me.Adapter.UpdateCommand.Connection.Open
End If
The System.Data has the squiggly blue underline attached to the Error message.
I cannot find help on this anywhere. Do I need to add a particular reference to my project? Am I doing something wrong?
Help!
Thanks,
Trav
|
|
|
|
|
The above code is interesting, but I already have a connection, and am passing the row id to the module. All I want to do is get the information from that row of data. There must be an easier way? Thanks
sdkgolf
|
|
|
|