|
Create a directory with a formatted GUID as the name.
|
|
|
|
|
can you please explain your answer a little more with some sample code?
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
i mean, i can create a directory, but don't know how to create a directory with a formatted GUID as the name.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
System.Guid.NewGuid().ToString()
|
|
|
|
|
Does any 1 have any idea how to join a m/c to a domain to which it is physically connected?
Sankalp Verma
|
|
|
|
|
Hi there,
I am trying develope an internet chat application in C#.Net using Visual Studio 2005.
I am struggling succeeding in this and basically ended up creating a network chat app.
What i want to do is create an app that direct chats over the internet (like on a network chat). only my friend and myself will use it so no rooms or anything is needed its just a plain direct chat over the net.peer 2 peer like.
I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat.
Could anyone please help me with this or direct me somewhere where i can get help please?
Kind Regards
Deon
|
|
|
|
|
Tell me 1 thing buddy are you in a private n/w or on the public n/w?
If youa re in a public n/w thn it should not b a issue.
|
|
|
|
|
Im in a private network and my friend will be in a public network.
hmmmm i guess firewalls will be a problem ouch.
any suggestions maybe?
im so confused and i know this is not alot of code it only has to be the most simplest
app which sends text like p2p.
i have some code i you want to take a look at it and maybe direct me from there.
Thanks alot
|
|
|
|
|
If neither of you has a static ip then you'll need a web service to keep track of the ip-s for peer discovery, even if the app will be used by only the two of you.
|
|
|
|
|
yea you right but my friend will have a static ip i think and with me well im using a netowrk ip address to connect to the internet.
funny actually i dont know lol
well for now lets say both of us have a static ip.
here is the code i have so far what do you guys think?
ok this is written so for now you chat with yourself. the strfriend will be the ip of my friend obviously lol.
<br />
using System;<br />
using System.Windows.Forms;<br />
using System.Drawing;<br />
using System.Net.Sockets;<br />
using System.Threading;<br />
using System.IO;<br />
using System.ComponentModel;<br />
using System.Net;<br />
using System.Drawing.Drawing2D;<br />
<br />
namespace MyTalk<br />
{<br />
public partial class Chat : Form<br />
{<br />
private TcpClient objClient;<br />
private Thread thdListener;<br />
private TcpListener objListener;<br />
private string strFriend;<br />
private string strMe;<br />
<br />
IPAddress ipadd;<br />
public delegate void Invoker(String t);<br />
<br />
public Chat()<br />
{<br />
strFriend = "10.0.1.166";<br />
ipadd = Dns.GetHostEntry(strFriend).AddressList[0];<br />
strMe = "Me";<br />
<br />
thdListener = new Thread(new ThreadStart(this.Listen));<br />
thdListener.Start();<br />
<br />
InitializeComponent();<br />
}<br />
<br />
private void Listen()<br />
{<br />
string strTemp = "";<br />
objListener = new TcpListener(ipadd,1000);<br />
objListener.Start();<br />
do<br />
{<br />
TcpClient objClient = objListener.AcceptTcpClient();<br />
StreamReader objReader = new StreamReader(objClient.GetStream());<br />
while (objReader.Peek() != -1)<br />
{<br />
strTemp += Convert.ToChar(objReader.Read()).ToString();<br />
}<br />
object[] objParams = new object[] { strTemp };<br />
strTemp = "";<br />
this.Invoke(new Invoker(this.ShowMessage), objParams);<br />
} while (true != false);<br />
}<br />
<br />
private void ShowMessage(String t)<br />
{<br />
rtbMessage.Text += strFriend + ": " + t + "\n";<br />
}<br />
<br />
private void btExit_Click(object sender, EventArgs e)<br />
{<br />
objListener.Stop();<br />
Application.Exit();<br />
Environment.Exit(0); <br />
}<br />
<br />
private void btSend_Click(object sender, EventArgs e)<br />
{<br />
rtbMessage.Text += strMe + ": " + rtbType.Text + "\n";<br />
objClient = new TcpClient(strFriend, 1002);<br />
StreamWriter w = new StreamWriter(objClient.GetStream());<br />
w.Write(rtbType.Text + "\n");<br />
w.Flush();<br />
objClient.Close();<br />
rtbType.Text = ""; <br />
}<br />
|
|
|
|
|
You've got a full 101-key keyboard in front of you - use it. SMS-speak is frowned upon because it makes your posts hard to read.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
GermanDM wrote: I know the using of sockets or remoting but everywhere i look it all just goes down to an tcp/ip chat.
You do know what TCP/IP means? it means Transmission Control Protocol over Internet Protocol. Which should give you a clue to how data is transmitted over the internet.
|
|
|
|
|
I've been to the database and retrieved 1 or more values from a table that match with values for my ListBox text. eg
1 = John
2 = Peter
3 = Fred
etc
I have values say, 1 and 3 in a dataSet and can view each row
I want to get back to my page and have 1 or more names (John and Fred) highlighted. It's fine if there is one but multiple?
Code so far :
for (int i=0;i < dataSet.Tables[0].Rows.Count; i++)
{
mylistbox.SelectedValue = dataSet.Tables[0].Rows[i]
"PersonID"].ToString();
}
This only highlights Fred, the last row in my listbox on my page.
Any advice would be great.
|
|
|
|
|
You can create a ListItem and set its Selected property to true. Or iterate throught
ListItems in your ListBox .
Something like this:
int i = 0
foreach(ListItem li in ListBox1.Items)
{
if( (li.Value == dataSet.Tables[0].Rows[i]["PersonID"].ToString())
{
li.Selected = true;
}
i += 1;
}
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
|
Hi All,
I have a little problem...
From one form to another i am sending an array list.
ArrayList _line = new ArrayList();<br />
_line.Add(strNum);<br />
new frmCellNumberListCheck().Chekker(ref _line);
On the next form i have a list view. How do i populate the a list view with the values in my array list?
Here is the part on my next form...
public void Chekker(ref ArrayList _NewList)<br />
{<br />
_Confirmer = _NewList;<br />
this.ShowDialog();<br />
NewList = _Confirmer;<br />
}
Now in the load method of the form i want to use the _Confirmer to populate the listview called ChekkerList.
How do i go about doing so...
Thank you in advance
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
u can try
ListViewItem lst = new ListViewItem();
for(int i=0 ;i < _NewList.Count ;i++)
{
lst.subitems.add(_NewList[i].ToString());
}
CheckerList.items.add(lst);
-- modified at 6:51 Friday 27th October, 2006
rahul
|
|
|
|
|
Hi!
I try to make som kind of install monitor program, I try sevral ways, the current working soltion is take before and after snapshots, and compares it. The problem with it, is the other activities on the computer, to filter it, I must know who make the canges.
Can somebody tell me how can I monitor the filesystem, and registry changes, occures by a specified application/thread?
I opened for any soltion.
Thanks for help!
|
|
|
|
|
plz help me
i am new to word addins i want to create my menubar for word document by using c# sheared addins i am not able to inshilize word menubar object
private Office.CommandBar menuBar;
menuBar = this.ActiveExplorer().CommandBars.ActiveMenuBar;
|
|
|
|
|
Hello,
i am using a treeview so to assign different icons to different nodes i used a imagelist and assigning the imageindex and selected imageindex properties of the treenodes with the index of the imagelist icons collection. But for some nodes in the treeview that setting is not working its displaying the icon at the 0th index in the imagelist and whenever i display the index value associated with that node using a messagebox its giving "-1" value.
Why thats happening how can i get the icon which i assigned using imageindex and selectedindex to those nodes.
Please help me,
thanks in advance.
|
|
|
|
|
i'm new cumer for C#,so i have created small programme that display sum details as wel as retrive there details as they want.so i've puted the menu there for open a new windows when user to view many windows,hw can i give coding for that?
In VB.net i can give
Main Window name-:frmmain
In the sub window i can create object of the main window an call that window from the sub window like as follows
dim object_name as new frmmain
object_name.show()
how can i give coding for call the windows in C#?
|
|
|
|
|
The way I read it you want to open a new Window..
form name: frmName
frmName frmName = new frmName();
frmName.Show();
If you didn't mean to open a form then I am misreading your post and am sorry
|
|
|
|
|
Chris Maunder wrote: Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Click here![^]
Regards
|
|
|
|
|
How to generate a random number.
I have Visual Studio 2003.
Help.
Vasildb
|
|
|
|
|
use the following code snippet:
Random rand=new Random();
and then u can use
rand.Next(1,100);
to generate a random no. between 1 & 100
Basically u have to specify the limits in which u want to generate a random no.
Hope this will work.
NEHA GUPTA
|
|
|
|