|
Thank you so much for your explanation below.
Yours,
Visoth
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
I am meeting a problem in sending SMS from Website, if you have code about it, send me please! thank for your helping! I hope you can help me, send me early, I am waiting it!
|
|
|
|
|
While you're waiting you can read this[^]
only two letters away from being an asset
|
|
|
|
|
1 - we have an ASP.NET forum
2 - there is NO code to send an SMS. Instead, you need to find a local SMS provider ( don't forget to make sure it works where your client's server is, and not just where you are ). Any decent SMS provider will cost money. Free ones tend to disappear.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I was under the impression that SMSs were just emails. You could send an SMS to any phone by sending an email to the phone number at the service provider's SMS domain. Somebody got a hold of my cell phone number and kept sending me SMS emails and pictures. I had to go to Verizon and have them block all messages that originate from an email server and not a cell phone. What's interesting to me is that they have a checkbox option on the accounts to do just that.
Don't blame me. I voted for Chuck Norris.
|
|
|
|
|
FyreWyrm wrote: I was under the impression that SMSs were just emails. You could send an SMS to any phone by sending an email to the phone number at the service provider's SMS domain.
That would be news to me. If that's the case, why are there commercial SMS services ? They generally provide a webservice you connect to, and then you pay for use.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
That works for some providers, but not all. It used to work on Orange, but now your emails just bounce
|
|
|
|
|
Hi everyone, I am trying to change windows title text programatically, but do not know how.
I am working on win form app. I want to change for example Form1 to X. How do I do it? not
manually through propertry window. application run time I want to change it.
thanks
|
|
|
|
|
In the necessary place in your Form1's code:
Text = "X";
this.Text = "X"; This is very basic stuff. You really should study a book and/or some online getting started tutorials before asking questions in a forum. We don't mind helping when you're stuck - but we're not pre-'coding school' teachers.
|
|
|
|
|
thanks dave ,
I could not figur it out anyway. do not know why.
as you know it can be trivial but tricky.
|
|
|
|
|
Well the property window tells you the property name, you know your Forms name, putting 2 and 2 together shouldn't be tricky. I would take Dave's advice and get a beginners book.
|
|
|
|
|
public static void getyn(ref Form org_form)
{
org_form.Enabled=False;
}
The simple method above illustrates how I can disable a form that has been instantiated elsewhere, using a reference parameter. If I instantiate a form "test_this", and in that code, I call this method above passing "test_this", this works. But now I want to access "test_this" or "org_form" (to me, they are the same for this issue) in another method (ie. org_form.Enabled=True;), such as within a button click event of another form. In that code, I do not know what name was used to instantiate the form. My thought would be to somehow create some public reference or pointer in this "getyn" method so that I can access this elsewhere. There must be some way to make "org_form" available/public so it can be accessed in other methods?
|
|
|
|
|
First of all, there is no need for the ref for your parameter. Form is a class and therefore passed by reference anyway.
Secondly, passing Forms around and making instances of them public to external classes is a BAD idea.
Ask yourself - what object owns what?
1. If the Form is owned by the other object, then when it creates the form it can store a reference to it for later use.
2. If the Form owns the other object , then the other object should raise events which the Form subscribes to after instanciation of the object.
3. If there is no direct relationship between the Form and the other object then I would recommend a 'manager' class that can instanciate the form and the other object, store references to them and subscribe to their events so it can handle communication between them.
Edit: A little diagram to show what I mean:
One and Two:
|---------------------------------------------------------------|
Parent V Child |
=================================== =================================== |
|-----------Subscriptions---------| |-----------Subscriptions---------| |
|Properties ============= Events | |-->|Properties ============= Events | >---|
|-----------| OBJECT |---------| | |-----------| OBJECT |---------|
|Methods ============= Call/Set| --|-->|Methods ============= Call/Set|
=================================== ===================================
Three:
|--------------------------------------------|
Manager V |
=================================== |
|-----------Subscriptions---------| |
|Properties ============= Events | |
|-----------| OBJECT |---------| |
|Methods ============= Call/Set| >---| |
=================================== | |
|---------------------------------------------|-------------------| |
| | |
| | |
| =================================== | =================================== |
| |-----------Subscriptions---------| | |-----------Subscriptions---------| |
|-->|Properties ============= Events | >--| |-->|Properties ============= Events | >--|
| |-----------| OBJECT |---------| | | |-----------| OBJECT |---------| |
|-->|Methods ============= Call/Set| | |-->|Methods ============= Call/Set| |
=================================== | =================================== |
|---------------------------------------------|
modified on Thursday, October 22, 2009 3:24 PM
|
|
|
|
|
Wow - you created a diagram and all and got no response, and no 5 ? I corrected it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
fived
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Pleaseeee...help me!!i'm so confused find the right code to copy my image from my picturebox,to new page at Adobe Photoshop.And i want the picture that i move with original type of files.(ex.if the image in .png,then when i drag to photoshop,it still in .eps format.)
i don't know how to do it.Can anyone help me solve this problem?i need it very much.thx
|
|
|
|
|
You have no control whatsoever over what Photoshop does when you drag and drop a picture. However, the picture will be a bitmap in memory, Photoshop is just trying to save in it's default format when you try to save a file.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
OK, so I have my TabControl, which is by the way owner drawn, and I have my TabPages. I want to make the user able to, when a TabPage is clicked and the mouse is moving, move the contents of the TabPage. Now, the moving is working, but my MouseMove event is firing even though my mouse isn't moving!
This is the code:
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
bool foundItem = false;
int index = -1;
foreach (TabPage page in this.TabPages)
{
index++;
if (this.GetTabRect(index).Contains
(e.Location) == true)
{
_hoverIndex = index;
this.Invalidate();
foundItem = true;
if (this.TabMouseEnter != null)
{
TabMouseEventArgs tabArgs = new TabMouseEventArgs();
tabArgs.TabPage = page;
this.TabMouseEnter(this, tabArgs);
}
}
else if (foundItem == false)
{
_hoverIndex = -1;
this.Invalidate();
if (this.TabMouseLeave != null)
{
TabMouseEventArgs tabArgs = new TabMouseEventArgs();
tabArgs.TabPage = page;
this.TabMouseLeave(this, tabArgs);
}
}
}
if (e.Button == MouseButtons.Left)
{
if (_hoverIndex != -1)
{
DockStyle dockStyle = this.DockPanel.Dock;
this.DockPanel.DockPane.HideDockRectangles();
DockForm dockForm = new DockForm();
DockPanel dockPanel = this.DockPanel;
this.DockPanel.DockPane.Controls.Remove(dockPanel);
dockPanel.Dock = DockStyle.Fill;
dockForm.Location = Cursor.Position;
dockForm.Controls.Add(dockPanel);
dockForm.Renderer = this.Renderer;
dockForm.Show();
this.DockPanel.DockForm = dockForm;
List<TabPage> removePages = new List<TabPage>();
foreach (TabPage page in this.TabPages)
{
if (page != this.DockPanel.MainTabPage)
removePages.Add(page);
}
foreach (TabPage page in removePages)
{
foreach (Control control in page.Controls)
{
if (control is DockContainer)
{
DockContainer container = control as DockContainer;
this.DockPanel.DockPane.CreatePanel(container.Form, dockStyle);
this.TabPages.Remove(page);
}
}
}
}
}
}
This is really the only related code. Any ideas?
|
|
|
|
|
Theodor Storm Kristensen wrote: Any ideas?
It seems to be designed that way[^].
I are Troll
|
|
|
|
|
Thanks for the link, it works now.
|
|
|
|
|
I can't believe I'm doing this...
In my job, I have to digitally sign .MSI files before deployment. Previously, this was done using the CAPICOM 2.1 library and a manual wizard-based process to sign the .MSI.
Seeing an opportunity for process improvement, I scripted this process into a drag-and-drop operation where you just drop the .MSI file on the script and it would use the CAPICOM COM objects to find the appropriate code-signing certificate and sign the file for you, baking the signed hash into the file. When you went out to Explorer, you get the properties on the file and click the Digital Signatures tab, whaalaa, you can see the signature!
This process worked great under Windows XP...
Now, move to Windows 7 (we're skipping Vista! ). CAPICOM is no longer in the Windows SDK and is no longer supported as it is offically deprecated by MS. MS says that the same functionality CAPICOM provided can be cobbled together using managed code and the .NET Framework.
I've tried to get CAPICOM to work under Windows 7, but I haven't been able to get any of the COM objects to instantiate. So, now I'm trying to poke around the classes under the System.Security.Cryptography namespace and put together a process to digitally sign an .MSI file (or any other file for that matter,) but do it the with the signature in the file. Having a seperate signed hash in a p7s file does me no good. It must be baked into the .MSI just like the old CAPICOM process did it.
Anyone got any clues or research points to rebuilding this process in managed code? Which classes am I looking at?? I can see the the X509 certificates using the classes in the System.Security.Cryptography.X509Certificates namespace, but can't seem to piece together the signing process. What am I missing?
|
|
|
|
|
For the offical word on CAPICOM support under Windows 7, read this[^].
After about 90 minutes of excersizing my Google Fu, I finally found this[^], which states that I'll have to resort to P/Invoking the Win32 functions I need to get the files signed with an embedded signature. Yuk! Why couldn't they provide an entirely managed solution to replace CAPICOM?!
|
|
|
|
|
Hi,
I need to write a program which can copy a file simply from a source folder to a destination folder.
Please include the codes for a simple program doing so.
|
|
|
|
|
Below is the sample VB.NET Code. Hope you can convert it easily using C#.
using System.IO
Public Sub CopyDir(ByVal strSrc As String, ByVal strDest As String)
Dim dirInfo As New DirectoryInfo(strSrc)
Dim fsInfo As FileSystemInfo
If Not Directory.Exists(strDest) Then
Directory.CreateDirectory(strDest)
End If
For Each fsInfo In dirInfo.GetFileSystemInfos
Dim strDestFileName As String = Path.Combine(strDest, fsInfo.Name)
If TypeOf fsInfo Is FileInfo Then
File.Copy(fsInfo.FullName, strDestFileName, True)
'This will overwrite files that already exist
Else
CopyDir(fsInfo.FullName, strDestFileName)
End If
Next
End Sub
Source : http://abhijitjana.blogspot.com/2007/10/copy-files-from-one-directory-to.html[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
If you keep writing their code for them the will pass the exams, and one day you may end you having to mantain some of their code - even worse, I may end up having to fix it
Give a hint, but please refrain from giving code for something as trivial as this otherwise they will never learn that one of the more important aspects of development is learning how to work things out for yourself. I mean, how difficult is it to go to google and put in file copy c# and look at the top few of the 815,000 hits.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|