-1

I have capturing images from webcam and storing them in a folder. The path of folder and name of image is provided i.e. hard coded into code. Now I don't want to hard code the name of image, I want to create it dynamically. I am giving the path as

 String string_ip="F:\\gatepass\\Gatepass\\Images\\rose.jpg";

Here I want to create name rose.jpg as dynamically, and also I want to give name as user name (user name is fetched from database) But I am unable to do that, Please help me.

4

1 に答える 1

0

それは次のように単純でなければなりません

String base_url="F:\\gatepass\\Gatepass\\Images\\{0}.jpg";

String username_from_DB = "rose"

String string_ip = MessageFormat.format(base_url,username_from_DB);

次に、保存する前と同じように、画像を string_ip に保存します。

于 2012-06-18T07:27:45.427 に答える