|
Use following code
Dim strPath As String = "C:\Gaurav"
Dim dir As String = IO.Path.Combine(strPath, "Temps")
Dim dirSecurity As New System.Security.AccessControl.DirectorySecurity
Dim rul As New Security.AccessControl.FileSystemAccessRule("Everyone", Security.AccessControl.FileSystemRights.FullControl, Security.AccessControl.AccessControlType.Allow)
dirSecurity.AddAccessRule(rul)
IO.Directory.CreateDirectory(dir, dirSecurity)
Dim sharename As String = "ServerFolder"
Dim cmdstring As String = "cmd /c net share """ & sharename & """=""" & dir & """" & " /unlimited"
Shell(cmdstring)
|
|
|
|
|
The basic code behind creating a share can be found here[^]. It's in C#, but is easily translatable to VB.NET using any online code conversion tool.
|
|
|
|
|
-------------------------------------------------------------------
:::: Great Indian Developer Summit 2009 - GIDS .Net ::::
:::: 24 April 2009 ::::
:::: J N Tata Auditorium, IISc, Bangalore ::::
:::: http://www.developersummit.com ::::
-------------------------------------------------------------------
Dear Group members,
The economic downturn will run out of steam trying to outdo the 'ready and waiting' software professional. Packed with premium knowledge, action plans and advise from been-there-done-it veterans, creators, and visionaries, the 2009 edition of Great Indian Developer Summit features focused sessions, case studies, workshops and power panels that will transform you into a force to reckon with.
Dot Net Speakers at the 2009 edition of GIDS include: Todd Anglin, Beat Schwegler, Chad Hower, Donald Belcham, Venkat Subramaniam, Kevin Babcock, Stephen Forte, Nikhil Kothari and Prabhu Sunderraman. The conference this year has sessions on Visual Studio 2008 & .NET 3.5, ADO.NET Entity Framework, T-SQL, ASP.NET AJAX 4.0, Databases/SQL Server/Language Integrated Query (LINQ), C# 4.0/WF/WCF/WPF, BizTalk Server/BPM/SOA, SharePoint & Search, Visual Studio Team System, ASP.Net MVC, Silverlight, Spring .NET, DWM, cool and new technologies from the Microsoft Stables. and much more. Please have a look at http://www.developersummit.com/speakers.html for more info on the speakers and the sessions.
Register before the 29th of December for Rs. 1,999/-. Besides the learning at the GIDS.Net conference on Wednesday, the 22nd of April, this fee also includes:
1. Discount of 35% on the standard fee
2. Assured Gift - GIDS 2009 Cult T-shirt (upon receipt of payment on or before Jan 12 2009)
3. Entry into a lucky draw for the following gifts: Sony WEGA 29 inches (1), Mac Air Book (1), Wireless Mouse (50 nos), Apple iPOD 120 GB (5 nos).
4. Lunch and refreshments
5. Conference materials
6. Complimentary invitation to Cyrus Broacha's show at the Great Indian Developer Awards on Saturday, the 25th of April 2009
So hurry up and register now under the GIDS Loyalty discount scheme: http://www.developersummit.com/registration.html
Wishing you and your family a Merry Christmas and a wonderful year ahead.
Thanks,
Shaguf
http://www.developersummit.com/
info@developersummit.com
|
|
|
|
|
Message reported as spam.
|
|
|
|
|
hey, guys i was wondering if anyone can help me debug this code as i have been trying for days and still have not find out the mistake i make. The portion which i have posted is one of the sub in my server application. I edited the code i found so that the server is able to reply to its client and after editing server do make the reply but with some bug. For the 1st request from the client, the reply is perfectly fine but subsequent request, the browser omit 2 front letters of the sentence and i don't understand why.Struck with this error with quite some time already.
Help will be greatly appreciated.
Private Sub doChat()
Dim infiniteCounter As Integer
Dim requestCount As Integer
Dim bytesFrom(10024) As Byte
Dim dataFromClient, DataToClient As String
Dim sendBytes As [Byte]()
Dim serverResponse As String
Dim rCount As String
requestCount = 0
For infiniteCounter = 1 To 2
infiniteCounter = 1
Try
requestCount = requestCount + 1
Dim networkStream As NetworkStream = _
clientSocket.GetStream()
networkStream.Read(bytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
dataFromClient = System.Text.Encoding.ASCII.GetString(bytesFrom)
dataFromClient = _
dataFromClient.Substring(0, dataFromClient.IndexOf("$"))
msg("From client - " + clNo + " : " + dataFromClient)
rCount = Convert.ToString(requestCount)
serverResponse = "ok"
sendBytes = System.Text.Encoding.ASCII.GetBytes(serverResponse)
networkStream.Write(bytesFrom, 0, serverResponse.Length)
msg("From Server - " + serverResponse)
DataToClient = networkStream.Read(sendBytes, 0, sendBytes.Length)
broadcast(dataFromClient, clNo, True)
broadcast(serverResponse, "Server", True)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
End Sub
|
|
|
|
|
Hi,
your code is hard to read without proper formatting; please use the PRE tags for
code blocks that span several lines, they provide a non-proportional font, and pteserve
formatting (indentation).
Anyhow, networkStream.Write(bytesFrom, 0, serverResponse.Length) looks
suspicious to me: why would serverResponse determine how many bytes from "bytesFrom" should
be written?
|
|
|
|
|
Is tis ok?
Private Sub doChat()
Dim infiniteCounter As Integer
Dim requestCount As Integer
Dim bytesFrom(10024) As Byte
Dim dataFromClient, DataToClient As String
Dim sendBytes As [Byte]()
Dim serverResponse As String
Dim rCount As String
requestCount = 0
For infiniteCounter = 1 To 2
infiniteCounter = 1
Try
requestCount = requestCount + 1
Dim networkStream As NetworkStream = _
clientSocket.GetStream()
networkStream.Read(bytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
dataFromClient = System.Text.Encoding.ASCII.GetString(bytesFrom)
dataFromClient = _
dataFromClient.Substring(0, dataFromClient.IndexOf("$"))
msg("From client - " + clNo + " : " + dataFromClient)
rCount = Convert.ToString(requestCount)
serverResponse = "ok"
sendBytes = System.Text.Encoding.ASCII.GetBytes(serverResponse)
networkStream.Write(bytesFrom, 0, serverResponse.Length)
msg("From Server - " + serverResponse)
DataToClient = networkStream.Read(sendBytes, 0, sendBytes.Length)
broadcast(dataFromClient, clNo, True)
broadcast(serverResponse, "Server", True)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
End Sub
|
|
|
|
|
That is more code than before, some of it in PRE tags??
And I still don't like the line networkStream.Write(bytesFrom, 0, serverResponse.Length)
As serverResponse contains "ok" its length will always be 2! is that what you intend?
|
|
|
|
|
It is the same amount of code i posted earlier. Those in the PRE tags are those code whereby i think my mistake is at. As for the serverRespone.Length, 2 is not the intended length but i already change it but it seen like there is not much different. The reply i got are all rubbish.
|
|
|
|
|
Hi to All
I want to change the textbox text color When textbox properties enable = False the font in the textbox become gray color. How do I change the gray color to black color ?
Thanx
Khatri Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
It's not possible to change forecolor when it is disabled.
You can use ReadOnly property instead.
|
|
|
|
|
Simple - you need to create an owner drawn control ( OK, it's not simple ).
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Agreed....and it really isn't that bad to do.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
You can do one more thing
use if condition when the u done disable operation don't do the disable show as disable.
|
|
|
|
|
hi
iwant to send sms from pc by data cabl conncted to nokia mobil 6300
how can i do it
|
|
|
|
|
There's no support for this built in, typically people pay to use a web service that allows them to send SMS. Your phone iwll have nothing to do with it,
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a form , which contains the button , on clicking the button opens a child form. If I again clicks that button , My program does not
open the duplicate instance , But I have a case when there is a usability issue.
1. If I change the window state of the child form window like I set Normal and afterwards I minimize it.
Then my program assumes that the child form is minimize and change it's state to maximize, But this should not happen ,
It should change the state to restore ,
How should i implement this
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
handle the event where the for is restored and set it's state to restore instead of maximise.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sir , After Restoring the form , I am minimizing the form , Now I am going to click the button to open the same form , system shall find that the user is trying to open the duplicate instance , Now , How should i change the window state to Restore as the window state is presently minimized ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
you're saying it maximises, right ? Well, you actually can change the window state, simply by setting it, it's a property on the form. But, I also mean you can handle it maximising and right away restore it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sorry , for questioning again and again in the thread...
Sir, I cannot do the hard code in this way.....
1.What should I do if it was maximized and then it is minimized?
2.What should I do if it is Restored and then it is minimized?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Hello Best coders,
I am from holland and i am busy with a MSN program that will give users Free extra msn options.
well that was about me now the question.
I want to give ability to change the MSN-Email adress that msn(chatters) will see.
*for example i am chatting the contact will see msnemail@msn.com
*Now the program needs to set the fake Email or a message instead of my msnemail@msn.com adress.
if my user name was: USERNAME
and if my personal message was: PERSONALMESSAGE
and if my email was: msnemail@msn.com
when a chat window is opened the contact will read on the top as following
BELOW YOU WILL SEE A MSN CHATWINDOW. Sorry but i could send screenshot
but this was more easy becaus i dont have paint anymore.LOL
---------------------------------------------------------------------------
USERNAME
PERSONALMESSAGE <msnemail@msn.com>
********************* Here are some msn icon-buttons **********************
****************** Here is is the status of the contact *******************
* USERNAME says: Hello
* Contact Says: I want to see your fake email instead of msnemail@msn.com
* USERNAME Says: well i am about to know that if i get helped on
* USERNAME Says: codeproject.com
* Contact Says: Thanks to codeproject.com ?
* USERNAME Says: Yup, thats right!
* Contact Says: Great i love codeproject.com!
********** HERE ARE MSN EMOTICON BUTTONS AND MORE LIKE WINKS *************
TYPE YOUR TEXT HERE>>>
SEND BUTTON
**************************************************************************
if if someone please can help me ...
i am using MESSENGER ApI, i couldnt come out of finding how to change my
email adress ... so user could see something i want them to see...
Greetings, happy new year !
|
|
|
|
|
AFAIK you can't spoof your email address on msn messenger, nor could I see a legitimate use to do so. No help will be given for such a illegitimate use.
|
|
|
|
|
i want to show frmLodingform while frmBooking is get loaded.
i have used BackgroundWorker Control
my frmLoadingform contains the progressbar type objects which displays the countdown while it is displayed on the screen continuously.
i want to show this form while opening, Refreshing the grid init and hide this form when grid gets loaded completely.
---------------------------------
i have given my code here
-----------------------------------------
Dim ofrm As New frmLodingform
Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
ofrm.ShowDialog()
''< if i use ofrm.show() then nothing will displayed on the screen only form border is shown.>
End Sub
-------------------------------
Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
''
End Sub
-----------------------
Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
ofrm.Close()
End Sub
------------------
and called methods like
Private Sub frmBookings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
BackgroundWorker1.RunWorkerAsync()
'''code here to load grid which is taking more time.
''after complete loading grid
BackgroundWorker1.CancelAsync()
|
|
|
|
|
You can't show the Form from the background worker. You have to show it from the UI thread, then update it from the background worker.
Other than that, I have no idea what your question is.
|
|
|
|
|